From 3f8d7daca60c27e3e23c3e1b54d44cd2c25a053b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 5 Jul 2018 13:30:01 +0300 Subject: forgotten check for non-local files --- plugins/Dbx_mdbx/src/libmdbx/src/osal.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'plugins/Dbx_mdbx/src') diff --git a/plugins/Dbx_mdbx/src/libmdbx/src/osal.c b/plugins/Dbx_mdbx/src/libmdbx/src/osal.c index c2fced0b4a..159fba965d 100644 --- a/plugins/Dbx_mdbx/src/libmdbx/src/osal.c +++ b/plugins/Dbx_mdbx/src/libmdbx/src/osal.c @@ -191,7 +191,7 @@ __cold void mdbx_panic(const char *fmt, ...) { abort(); } -/*----------------------------------------------------------------------------*/ + /*----------------------------------------------------------------------------*/ #ifndef mdbx_asprintf int mdbx_asprintf(char **strp, const char *fmt, ...) { @@ -862,11 +862,13 @@ int mdbx_mmap(int flags, mdbx_mmap_t *map, size_t size, size_t limit) { map->section = NULL; map->address = nullptr; - NTSTATUS rc = mdbx_check4nonlocal(map->fd, flags); - if (rc != MDBX_SUCCESS) - return rc; + if (!(flags & MDBX_EXCLUSIVE)) { + NTSTATUS rc = mdbx_check4nonlocal(map->fd, flags); + if (rc != MDBX_SUCCESS) + return rc; + } - rc = mdbx_filesize(map->fd, &map->filesize); + NTSTATUS rc = mdbx_filesize(map->fd, &map->filesize); if (rc != MDBX_SUCCESS) return rc; if ((flags & MDBX_RDONLY) == 0 && map->filesize != size) { -- cgit v1.2.3