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:
Léo Lam 2017-06-16 12:43:41 +02:00
parent aa63199977
commit 01faa5c852
1 changed files with 1 additions and 2 deletions

View File

@ -78,8 +78,7 @@ bool IsDirectory(const std::string& filename)
if (result < 0)
{
WARN_LOG(COMMON, "IsDirectory: stat failed on %s: %s", filename.c_str(),
GetLastErrorMsg().c_str());
WARN_LOG(COMMON, "IsDirectory: stat failed on %s: %s", filename.c_str(), strerror(errno));
return false;
}