From 30a80ff07ce1236507f022835cc3e745c569b5dd Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sun, 14 Oct 2018 18:13:40 +0300 Subject: [PATCH] mdbx: re-enable usage of lck-file in MDBX_EXCLUSIVE mode. Otherwise we should prohibit running read-only and write transactions simultaneously, but no reliable way to do this. Change-Id: I8805f10b37ffcddb612d869309b1cd5e04cfcc1e --- src/mdbx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/mdbx.c b/src/mdbx.c index e1e2df83..e4f344ae 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -6191,9 +6191,7 @@ static int __cold mdbx_setup_lck(MDBX_env *env, char *lck_pathname, mdbx_assert(env, env->me_fd != INVALID_HANDLE_VALUE); mdbx_assert(env, env->me_lfd == INVALID_HANDLE_VALUE); - const int open_flags = - (env->me_flags & MDBX_EXCLUSIVE) ? O_RDWR : O_RDWR | O_CREAT; - int err = mdbx_openfile(lck_pathname, open_flags, mode, &env->me_lfd, + int err = mdbx_openfile(lck_pathname, O_RDWR | O_CREAT, mode, &env->me_lfd, (env->me_flags & MDBX_EXCLUSIVE) ? true : false); if (err != MDBX_SUCCESS) { if (!(err == MDBX_ENOFILE && (env->me_flags & MDBX_EXCLUSIVE)) &&