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.
- is related to
-
SERVER-41353 Fix late calls to errnoWithDescription()
- Closed