From a3332c7c9bc36f13aace6543ebc719f833882dfc Mon Sep 17 00:00:00 2001 From: Ladislav Zezula Date: Mon, 17 May 2021 10:04:06 +0200 Subject: nError -> dwErrCode --- src/FileStream.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/FileStream.cpp') diff --git a/src/FileStream.cpp b/src/FileStream.cpp index 2266518..d15316a 100644 --- a/src/FileStream.cpp +++ b/src/FileStream.cpp @@ -34,16 +34,16 @@ // Local functions - platform-specific functions #ifndef STORMLIB_WINDOWS -static thread_local DWORD nLastError = ERROR_SUCCESS; +static thread_local DWORD dwLastError = ERROR_SUCCESS; DWORD GetLastError() { - return nLastError; + return dwLastError; } void SetLastError(DWORD dwErrCode) { - nLastError = dwErrCode; + dwLastError = dwErrCode; } #endif @@ -113,7 +113,7 @@ static bool BaseFile_Create(TFileStream * pStream) if(handle == -1) { pStream->Base.File.hFile = INVALID_HANDLE_VALUE; - nLastError = errno; + dwLastError = errno; return false; } @@ -166,7 +166,7 @@ static bool BaseFile_Open(TFileStream * pStream, const TCHAR * szFileName, DWORD if(handle == -1) { pStream->Base.File.hFile = INVALID_HANDLE_VALUE; - nLastError = errno; + dwLastError = errno; return false; } @@ -174,7 +174,7 @@ static bool BaseFile_Open(TFileStream * pStream, const TCHAR * szFileName, DWORD if(fstat64(handle, &fileinfo) == -1) { pStream->Base.File.hFile = INVALID_HANDLE_VALUE; - nLastError = errno; + dwLastError = errno; close(handle); return false; } @@ -244,7 +244,7 @@ static bool BaseFile_Read( bytes_read = read((intptr_t)pStream->Base.File.hFile, pvBuffer, (size_t)dwBytesToRead); if(bytes_read == -1) { - nLastError = errno; + dwLastError = errno; return false; } @@ -313,7 +313,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) { - nLastError = errno; + dwLastError = errno; return false; } @@ -368,7 +368,7 @@ static bool BaseFile_Resize(TFileStream * pStream, ULONGLONG NewFileSize) { if(ftruncate64((intptr_t)pStream->Base.File.hFile, (off64_t)NewFileSize) == -1) { - nLastError = errno; + dwLastError = errno; return false; } @@ -412,7 +412,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) { - nLastError = errno; + dwLastError = errno; return false; } @@ -594,7 +594,7 @@ static bool BaseMap_Open(TFileStream * pStream, LPCTSTR szFileName, DWORD dwStre // Did the mapping fail? if(bResult == false) - nLastError = errno; + dwLastError = errno; return bResult; #else -- cgit v1.2.3