From 781247651827fdd6dd6d4d5e9afa967f8adfa81b Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sun, 7 Jan 2018 17:06:11 +0300 Subject: [PATCH] mdbx: fix readonly mapping for Windows. Change-Id: Ie301d7af74ff91e802aa78af8cfb329f587137ee --- src/osal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osal.c b/src/osal.c index 07051232..d3397fd2 100644 --- a/src/osal.c +++ b/src/osal.c @@ -882,7 +882,7 @@ int mdbx_mmap(int flags, mdbx_mmap_t *map, size_t must, size_t limit) { if (!NT_SUCCESS(rc)) return ntstatus2errcode(rc); - SIZE_T ViewSize = limit; + SIZE_T ViewSize = (flags & MDBX_RDONLY) ? 0 : limit; rc = NtMapViewOfSection( map->section, GetCurrentProcess(), &map->address, /* ZeroBits */ 0,