aboutsummaryrefslogtreecommitdiff
path: root/src/FileStream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/FileStream.cpp')
-rw-r--r--src/FileStream.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/FileStream.cpp b/src/FileStream.cpp
index b5a0a6d..95f48a7 100644
--- a/src/FileStream.cpp
+++ b/src/FileStream.cpp
@@ -99,7 +99,7 @@ static bool BaseFile_Create(TFileStream * pStream)
if(handle == -1)
{
pStream->Base.File.hFile = INVALID_HANDLE_VALUE;
- dwLastError = errno;
+ SErrSetLastError(errno);
return false;
}
@@ -152,7 +152,7 @@ static bool BaseFile_Open(TFileStream * pStream, const TCHAR * szFileName, DWORD
if(handle == -1)
{
pStream->Base.File.hFile = INVALID_HANDLE_VALUE;
- dwLastError = errno;
+ SErrSetLastError(errno);
return false;
}
@@ -160,7 +160,7 @@ static bool BaseFile_Open(TFileStream * pStream, const TCHAR * szFileName, DWORD
if(fstat64(handle, &fileinfo) == -1)
{
pStream->Base.File.hFile = INVALID_HANDLE_VALUE;
- dwLastError = errno;
+ SErrSetLastError(errno);
close(handle);
return false;
}
@@ -230,7 +230,7 @@ static bool BaseFile_Read(
bytes_read = read((intptr_t)pStream->Base.File.hFile, pvBuffer, (size_t)dwBytesToRead);
if(bytes_read == -1)
{
- dwLastError = errno;
+ SErrSetLastError(errno);
return false;
}
@@ -299,7 +299,7 @@ static bool BaseFile_Write(TFileStream * pStream, ULONGLONG * pByteOffset, const
bytes_written = write((intptr_t)pStream->Base.File.hFile, pvBuffer, (size_t)dwBytesToWrite);
if(bytes_written == -1)
{
- dwLastError = errno;
+ SErrSetLastError(errno);
return false;
}
@@ -354,7 +354,7 @@ static bool BaseFile_Resize(TFileStream * pStream, ULONGLONG NewFileSize)
{
if(ftruncate64((intptr_t)pStream->Base.File.hFile, (off64_t)NewFileSize) == -1)
{
- dwLastError = errno;
+ SErrSetLastError(errno);
return false;
}
@@ -398,7 +398,7 @@ static bool BaseFile_Replace(TFileStream * pStream, TFileStream * pNewStream)
// "rename" on Linux also works if the target file exists
if(rename(pNewStream->szFileName, pStream->szFileName) == -1)
{
- dwLastError = errno;
+ SErrSetLastError(errno);
return false;
}
@@ -580,7 +580,7 @@ static bool BaseMap_Open(TFileStream * pStream, LPCTSTR szFileName, DWORD dwStre
// Did the mapping fail?
if(bResult == false)
- dwLastError = errno;
+ SErrSetLastError(errno);
return bResult;
#else