浏览代码

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 年之前
父节点
当前提交
bdcd5e7d03
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      system/jlib/jfile.cpp

+ 2 - 1
system/jlib/jfile.cpp

@@ -6355,7 +6355,8 @@ public:
         }
 #elif defined (__linux__)
         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
         UNIMPLEMENTED;
 #endif