mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 16:34:14 +08:00
mdbx: проверка pid только для запроса активной env.
This commit is contained in:
parent
6477e6c5de
commit
2fe01eee89
13
src/core.c
13
src/core.c
@ -8685,17 +8685,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