From 804b26bb85ddfe1363a315ab938065c9549587ae Mon Sep 17 00:00:00 2001 From: Ladislav Zezula Date: Wed, 31 Mar 2021 17:22:23 +0200 Subject: Test --- 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 50f6ea5..bfb5817 100644 --- a/src/FileStream.cpp +++ b/src/FileStream.cpp @@ -561,13 +561,11 @@ static bool BaseMap_Open(TFileStream * pStream, LPCTSTR szFileName, DWORD dwStre if(hFile != INVALID_HANDLE_VALUE) CloseHandle(hFile); - // If the file is not there and is not available for random access, - // report error - if(bResult == false) - return false; -#endif + // Return the result of the operation + return bResult; + +#elif defined(STORMLIB_HAS_MMAP) -#if defined(STORMLIB_MAC) || defined(STORMLIB_LINUX) struct stat64 fileinfo; intptr_t handle; bool bResult = false; @@ -596,13 +594,15 @@ static bool BaseMap_Open(TFileStream * pStream, LPCTSTR szFileName, DWORD dwStre // Did the mapping fail? if(bResult == false) - { nLastError = errno; - return false; - } -#endif + return bResult; - return true; +#else + + // File mapping is not supported + return false; + +#endif } static bool BaseMap_Read( -- cgit v1.2.3