mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-01 23:54:12 +08:00
mdbx: проверка pid только для запроса активной env (backport).
This commit is contained in:
parent
5abb6a9bbf
commit
6e4473777e
13
src/core.c
13
src/core.c
@ -8258,17 +8258,16 @@ static __inline int check_env(const MDBX_env *env, const bool wanna_active) {
|
|||||||
if (unlikely(env->me_signature.weak != MDBX_ME_SIGNATURE))
|
if (unlikely(env->me_signature.weak != MDBX_ME_SIGNATURE))
|
||||||
return MDBX_EBADSIGN;
|
return MDBX_EBADSIGN;
|
||||||
|
|
||||||
#if MDBX_ENV_CHECKPID
|
|
||||||
if (unlikely(env->me_pid != osal_getpid())) {
|
|
||||||
((MDBX_env *)env)->me_flags |= MDBX_FATAL_ERROR;
|
|
||||||
return MDBX_PANIC;
|
|
||||||
}
|
|
||||||
#endif /* MDBX_ENV_CHECKPID */
|
|
||||||
|
|
||||||
if (unlikely(env->me_flags & MDBX_FATAL_ERROR))
|
if (unlikely(env->me_flags & MDBX_FATAL_ERROR))
|
||||||
return MDBX_PANIC;
|
return MDBX_PANIC;
|
||||||
|
|
||||||
if (wanna_active) {
|
if (wanna_active) {
|
||||||
|
#if MDBX_ENV_CHECKPID
|
||||||
|
if (unlikely(env->me_pid != osal_getpid())) {
|
||||||
|
((MDBX_env *)env)->me_flags |= MDBX_FATAL_ERROR;
|
||||||
|
return MDBX_PANIC;
|
||||||
|
}
|
||||||
|
#endif /* MDBX_ENV_CHECKPID */
|
||||||
if (unlikely((env->me_flags & MDBX_ENV_ACTIVE) == 0))
|
if (unlikely((env->me_flags & MDBX_ENV_ACTIVE) == 0))
|
||||||
return MDBX_EPERM;
|
return MDBX_EPERM;
|
||||||
eASSERT(env, env->me_map != nullptr);
|
eASSERT(env, env->me_map != nullptr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user