FileUtil: Use errno for printing errors in IsDirectory
stat() returns an error code in errno on both POSIX compliant platforms and Windows. This means we should always use errno instead of GetLastErrorMsg which uses GetLastError() (Win32) on Windows.
This commit is contained in:
parent
aa63199977
commit
01faa5c852
|
@ -78,8 +78,7 @@ bool IsDirectory(const std::string& filename)
|
||||||
|
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
{
|
{
|
||||||
WARN_LOG(COMMON, "IsDirectory: stat failed on %s: %s", filename.c_str(),
|
WARN_LOG(COMMON, "IsDirectory: stat failed on %s: %s", filename.c_str(), strerror(errno));
|
||||||
GetLastErrorMsg().c_str());
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue