mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-20 05:28:21 +08:00
mdbx: fix opening DB on a network shares (pass MDBX_EXCLUSIVE from env).
Change-Id: Ic5c68033ba81043ac7800f99aae364bf082c868f
This commit is contained in:
parent
0f3b82f661
commit
e8fecd1eec
@ -10079,7 +10079,8 @@ static int __cold mdbx_setup_lck(MDBX_env *env, char *lck_pathname,
|
|||||||
}
|
}
|
||||||
env->me_maxreaders = (unsigned)maxreaders;
|
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
|
lck_seize_rc ? MMAP_OPTION_TRUNCATE | MMAP_OPTION_SEMAPHORE
|
||||||
: MMAP_OPTION_SEMAPHORE);
|
: MMAP_OPTION_SEMAPHORE);
|
||||||
if (unlikely(err != MDBX_SUCCESS))
|
if (unlikely(err != MDBX_SUCCESS))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user