mdbx: fix opening DB on a network shares (pass MDBX_EXCLUSIVE from env).

Change-Id: Ic5c68033ba81043ac7800f99aae364bf082c868f
This commit is contained in:
George Hazan 2020-10-07 23:07:21 +03:00 committed by Leonid Yuriev
parent 0f3b82f661
commit e8fecd1eec

View File

@ -10079,7 +10079,8 @@ static int __cold mdbx_setup_lck(MDBX_env *env, char *lck_pathname,
}
env->me_maxreaders = (unsigned)maxreaders;
err = mdbx_mmap(MDBX_WRITEMAP, &env->me_lck_mmap, (size_t)size, (size_t)size,
err = mdbx_mmap((env->me_flags & MDBX_EXCLUSIVE) | MDBX_WRITEMAP,
&env->me_lck_mmap, (size_t)size, (size_t)size,
lck_seize_rc ? MMAP_OPTION_TRUNCATE | MMAP_OPTION_SEMAPHORE
: MMAP_OPTION_SEMAPHORE);
if (unlikely(err != MDBX_SUCCESS))