aboutsummaryrefslogtreecommitdiff
path: root/src/FileStream.cpp
diff options
context:
space:
mode:
authorLadislav Zezula <zezula@volny.cz>2021-03-31 17:40:34 +0200
committerGitHub <noreply@github.com>2021-03-31 17:40:34 +0200
commit0a9057a09f083eb4791a55eb3d9538cea9822e37 (patch)
treed28b9cd9a884ddbf7c89de7170c638e8a9230e27 /src/FileStream.cpp
parentce159e90bca94be3c9050fe467d497cfcbe759a8 (diff)
parent48f26f9f75a840a31b86a245f974009edf6d90bf (diff)
Merge pull request #209 from ladislav-zezula/MmapTest
Mmap test
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 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(