summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2015-01-02 19:18:06 +0000
committerChris Wilson <chris+github@qwirx.com>2015-01-02 19:18:06 +0000
commit640542ba69d99109b212ea74dde2b59f4fe1b837 (patch)
tree1814f567a8de76a449801d1464110a9588da7286
parent289169081c6a92c0dd6f83c3835b5e4a4dda7736 (diff)
Fix error logging when file open fails on Windows.
We need to use the saved Windows error code from GetLastError(), rather than calling it again, because another system call has run in the mean time and GetLastError() will now return 0.
-rw-r--r--lib/common/FileStream.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/common/FileStream.cpp b/lib/common/FileStream.cpp
index e38e5d38..51752f85 100644
--- a/lib/common/FileStream.cpp
+++ b/lib/common/FileStream.cpp
@@ -70,13 +70,13 @@ void FileStream::AfterOpen()
#ifdef WIN32
if(errno == EACCES)
{
- THROW_WIN_FILE_ERROR("Failed to open file", mFileName,
- CommonException, AccessDenied);
+ THROW_WIN_FILE_ERRNO("Failed to open file", mFileName,
+ winerrno, CommonException, AccessDenied);
}
else
{
- THROW_WIN_FILE_ERROR("Failed to open file", mFileName,
- CommonException, OSFileOpenError);
+ THROW_WIN_FILE_ERRNO("Failed to open file", mFileName,
+ winerrno, CommonException, OSFileOpenError);
}
#else
if(errno == EACCES)