Browse Source

HPCC-21859 Report an exception if cannot map a shared object into memory

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 6 years ago
parent
commit
bdcd5e7d03
1 changed files with 2 additions and 1 deletions
  1. 2 1
      system/jlib/jfile.cpp

+ 2 - 1
system/jlib/jfile.cpp

@@ -6355,7 +6355,8 @@ public:
         }
         }
 #elif defined (__linux__)
 #elif defined (__linux__)
         ptr = (byte *) mmap(NULL, mapsz, writeaccess?(PROT_READ|PROT_WRITE):PROT_READ, MAP_SHARED|MAP_NORESERVE, hfile, realofs);
         ptr = (byte *) mmap(NULL, mapsz, writeaccess?(PROT_READ|PROT_WRITE):PROT_READ, MAP_SHARED|MAP_NORESERVE, hfile, realofs);
-            // error checking TBD
+        if (ptr == MAP_FAILED)
+            throw makeOsException(errno, "CMemoryMappedFile::reinit");
 #else
 #else
         UNIMPLEMENTED;
         UNIMPLEMENTED;
 #endif
 #endif