diff options
| author | Léo Lam <leo@innovatetechnologi.es> | 2017-06-16 12:43:41 +0200 |
|---|---|---|
| committer | Léo Lam <leo@innovatetechnologi.es> | 2017-06-16 12:43:41 +0200 |
| commit | 01faa5c852e218befdeed3b041ddf03688201e95 (patch) | |
| tree | 9c06f6127b37f72f24eb6360176f60c4d3e0486c /Source/Core/Common/FileUtil.cpp | |
| parent | aa63199977a21fcb78c371b025166ff7affc9e33 (diff) | |
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.
Diffstat (limited to 'Source/Core/Common/FileUtil.cpp')
| -rw-r--r-- | Source/Core/Common/FileUtil.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index 3c6c6449d3..597908f740 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -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; } |
