mdbx: fix lck-file mode-flag while opening existent DB.

Change-Id: I3b8d446f6a620e911c0d5e325d8d912f2ca19d93
This commit is contained in:
Leonid Yuriev 2019-11-17 23:55:16 +03:00
parent d20b9d9ed7
commit d390300e60

View File

@ -8827,6 +8827,17 @@ int __cold mdbx_env_open(MDBX_env *env, const char *path, unsigned flags,
}
#endif /* MDBX_LOCKING */
#if !(defined(_WIN32) || defined(_WIN64))
if (mode == 0) {
struct stat st;
if (fstat(env->me_fd, &st)) {
rc = errno;
goto bailout;
}
mode = st.st_mode;
}
#endif
const int lck_rc = mdbx_setup_lck(env, lck_pathname, mode);
if (MDBX_IS_ERROR(lck_rc)) {
rc = lck_rc;