Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-40953

Shell history file accesses should capture errno earlier

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor - P4 Minor - P4
    • 4.1.13
    • None
    • Shell
    • None
    • Fully Compatible
    • Sharding 2019-05-06, Sharding 2019-05-20, Sharding 2019-06-03

    Description

      In this code

      std::stringstream ss;
      ss << "Unable to " << what << " file " << filename << ": " << mongo::errnoWithDescription();
      

      errno is captured too late — it may have been reset by the stringstream by the time errnoWithDescription() uses it.

      There are also a few places where closing the file in response to an error, clobbers the actual errno of interest.

      Attachments

        Activity

          People

            kevin.pulo@mongodb.com Kevin Pulo
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: