aboutsummaryrefslogtreecommitdiff
path: root/src/FileStream.cpp
diff options
context:
space:
mode:
authorLadislav Zezula <ladislav.zezula@avast.com>2021-05-17 10:04:06 +0200
committerLadislav Zezula <ladislav.zezula@avast.com>2021-05-17 10:04:06 +0200
commita3332c7c9bc36f13aace6543ebc719f833882dfc (patch)
tree6f785736f3b5a61bcf162b15181c5fab92ccf24d /src/FileStream.cpp
parenta7ebfbccb7eb16f4852a7fd3bd6a738ecb7db423 (diff)
nError -> dwErrCode
Diffstat (limited to 'src/FileStream.cpp')
-rw-r--r--src/FileStream.cpp22
1 files changed, 11 insertions, 11 deletions
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