diff options
Diffstat (limited to 'ace/Mem_Map.cpp')
-rw-r--r-- | ace/Mem_Map.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ace/Mem_Map.cpp b/ace/Mem_Map.cpp index e79a5cabf7e..aa0d54cb188 100644 --- a/ace/Mem_Map.cpp +++ b/ace/Mem_Map.cpp @@ -206,6 +206,11 @@ ACE_Mem_Map::map (LPCTSTR file_name, mode, sa) == -1) return -1; + else if (ACE_BIT_ENABLED (flags, O_CREAT) + && len <= 0) + // <mmap> will fail if the length of the file mapping is 0, which + // will be the case if we've just created the file. + return 0; else return this->map_it (this->handle (), len, |