Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / metadata / file-mmap-posix.c
index c6c906bc098faaf23feb34e389b48fd046289940..3c971a091b5f907ea864a239e9e118b5f121e162 100644 (file)
@@ -303,7 +303,7 @@ static void*
 open_memory_map (const char *c_mapName, int mode, gint64 *capacity, int access, int options, int *ioerror)
 {
        MmapHandle *handle;
-       if (*capacity <= 0) {
+       if (*capacity <= 0 && mode != FILE_MODE_OPEN) {
                *ioerror = CAPACITY_MUST_BE_POSITIVE;
                return NULL;
        }