diff options
author | Ladislav Zezula <zezula@volny.cz> | 2025-07-03 09:33:14 +0200 |
---|---|---|
committer | Ladislav Zezula <zezula@volny.cz> | 2025-07-03 09:33:14 +0200 |
commit | 8d35b981c623de4c46afd933b0e7ac63aa7ca622 (patch) | |
tree | 7f9741fafac0026c199f3f687f7f63ad128fbec0 /src | |
parent | 486a7dd29f3bdf884d4be5588d9171daa5da1bae (diff) |
Fixed Linux build
Diffstat (limited to 'src')
-rw-r--r-- | src/FileStream.cpp | 16 |
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
|