Merge pull request #5675 from mono/glib-debug-symbols
[mono.git] / mono / metadata / file-mmap-windows.c
index e6d8cfd9a1edb0cbe737d9d41df80cded04387cf..59abd6686ffe192285513af90cccac7c23becd7a 100644 (file)
@@ -140,7 +140,7 @@ static void *open_handle (void *handle, MonoString *mapName, int mode, gint64 *c
        HANDLE result = NULL;
 
        if (handle == INVALID_HANDLE_VALUE) {
-               if (*capacity <= 0) {
+               if (*capacity <= 0 && mode != FILE_MODE_OPEN) {
                        *error = CAPACITY_MUST_BE_POSITIVE;
                        return NULL;
                }