mdbx: fix mdbx_env_open() for re-opening after non-fatal errors.

Change-Id: Ibbe9a8e017837a21fe1eeebb86e1b3a7a370e77c
This commit is contained in:
Leonid Yuriev 2020-09-01 18:43:48 +03:00
parent 8707fb89f3
commit 6b1c2ff762

View File

@ -10439,7 +10439,8 @@ int __cold mdbx_env_open(MDBX_env *env, const char *pathname,
bailout:
if (rc != MDBX_SUCCESS) {
rc = mdbx_env_close0(env) ? MDBX_PANIC : rc;
env->me_flags = saved_me_flags | MDBX_FATAL_ERROR;
env->me_flags =
saved_me_flags | ((rc != MDBX_PANIC) ? 0 : MDBX_FATAL_ERROR);
} else {
#if defined(MDBX_USE_VALGRIND) || defined(__SANITIZE_ADDRESS__)
mdbx_txn_valgrind(env, nullptr);