mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-17 17:48:20 -05:00
Clean up strange fcntl result check
...and check !MDB_CLOEXEC in an 'if' rather than '#if' to match its non-zero usage.
This commit is contained in:
parent
bffe2ebcba
commit
e674f8241c
1 changed files with 4 additions and 4 deletions
|
|
@ -4499,9 +4499,9 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl)
|
|||
#ifdef O_CLOEXEC /* Linux: Open file and set FD_CLOEXEC atomically */
|
||||
# define MDB_CLOEXEC O_CLOEXEC
|
||||
#else
|
||||
int fdflags;
|
||||
# define MDB_CLOEXEC 0
|
||||
#endif
|
||||
int fdflags;
|
||||
#endif
|
||||
int rc;
|
||||
off_t size, rsize;
|
||||
|
|
@ -4525,10 +4525,10 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl)
|
|||
}
|
||||
goto fail;
|
||||
}
|
||||
#if ! ((MDB_CLOEXEC) || defined(_WIN32))
|
||||
#ifndef _WIN32
|
||||
/* Lose record locks when exec*() */
|
||||
if ((fdflags = fcntl(env->me_lfd, F_GETFD) | FD_CLOEXEC) >= 0)
|
||||
fcntl(env->me_lfd, F_SETFD, fdflags);
|
||||
if (!(MDB_CLOEXEC) && (fdflags = fcntl(env->me_lfd, F_GETFD)) != -1)
|
||||
fcntl(env->me_lfd, F_SETFD, fdflags | FD_CLOEXEC);
|
||||
#endif
|
||||
|
||||
if (!(env->me_flags & MDB_NOTLS)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue