pathut: windows error message

This commit is contained in:
Jean-Francois Dockes 2020-09-29 13:50:31 +01:00
parent 013642b994
commit a85b1084c5

View File

@ -1303,16 +1303,18 @@ bool PathDirContents::opendir()
SYSPATH(dp, sysdir);
m->dirhdl = OPENDIR(sysdir);
#ifdef _WIN32
int rc = GetLastError();
LOGERR("opendir failed: LastError " << rc << endl);
if (rc == ERROR_NETNAME_DELETED) {
// 64: share disconnected.
// Not too sure of the errno in this case.
// Make sure it's not one of the permissible ones
errno = ENODEV;
if (nullptr == m->dirhdl) {
int rc = GetLastError();
LOGERR("opendir failed: LastError " << rc << endl);
if (rc == ERROR_NETNAME_DELETED) {
// 64: share disconnected.
// Not too sure of the errno in this case.
// Make sure it's not one of the permissible ones
errno = ENODEV;
}
}
#endif
return ! (nullptr == m->dirhdl);
return nullptr != m->dirhdl;
}
void PathDirContents::rewinddir()