From 439cccf65f69a05e423ffb6d3666e2f85d5f1145 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sat, 13 Mar 2021 19:40:00 +0300 Subject: [PATCH] mdbx: minor fix assertion in the prev commit. One more for https://github.com/erthink/libmdbx/issues/171. Change-Id: I49be3df948f3dbcc838f3dc307155ac404cfb331 --- src/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core.c b/src/core.c index 4e30d66d..2a321525 100644 --- a/src/core.c +++ b/src/core.c @@ -6565,9 +6565,10 @@ static __inline int check_env(const MDBX_env *env, const bool wanna_active) { if (unlikely(env->me_flags & MDBX_FATAL_ERROR)) return MDBX_PANIC; - if (wanna_active && unlikely((env->me_flags & MDBX_ENV_ACTIVE) == 0)) { + if (wanna_active) { + if (unlikely((env->me_flags & MDBX_ENV_ACTIVE) == 0)) + return MDBX_EPERM; mdbx_assert(env, env->me_map != nullptr); - return MDBX_EPERM; } return MDBX_SUCCESS;