mirror of
https://github.com/isar/libmdbx.git
synced 2024-10-30 11:29:19 +08:00
mdbx: fix lck-file mode-flag while opening existent DB.
Change-Id: I3b8d446f6a620e911c0d5e325d8d912f2ca19d93
This commit is contained in:
parent
d20b9d9ed7
commit
d390300e60
@ -8827,6 +8827,17 @@ int __cold mdbx_env_open(MDBX_env *env, const char *path, unsigned flags,
|
|||||||
}
|
}
|
||||||
#endif /* MDBX_LOCKING */
|
#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);
|
const int lck_rc = mdbx_setup_lck(env, lck_pathname, mode);
|
||||||
if (MDBX_IS_ERROR(lck_rc)) {
|
if (MDBX_IS_ERROR(lck_rc)) {
|
||||||
rc = lck_rc;
|
rc = lck_rc;
|
||||||
|
Loading…
Reference in New Issue
Block a user