-
Type:
Bug
-
Resolution: Done
-
Priority:
Minor - P4
-
Affects Version/s: None
-
Component/s: Internal Code
-
Environment:Windows
-
Fully Compatible
-
Windows
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
From code inspection:
src/mongo/db/instance.cpp lines 1008 to 1010:
#ifdef _WIN32 if( _chsize( lockFile , 0 ) ) log() << "couldn't remove fs lock " << WSAGetLastError() << endl;
WSAGetLastError() does not return anything useful here – this is for WinSock errors. Here, it will always print "0".
Better code would be:
#ifdef _WIN32 if( _chsize( lockFile , 0 ) ) log() << "couldn't remove fs lock " << errnoWithDescription(_doserrno) << endl;
which will print the errno value and the system text, for example:
couldn't remove fs lock errno:6 The handle is invalid.