|
|
@ -4818,9 +4818,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 */ |
|
|
|
#ifdef O_CLOEXEC /* Linux: Open file and set FD_CLOEXEC atomically */ |
|
|
|
# define MDB_CLOEXEC O_CLOEXEC |
|
|
|
# define MDB_CLOEXEC O_CLOEXEC |
|
|
|
#else |
|
|
|
#else |
|
|
|
int fdflags; |
|
|
|
|
|
|
|
# define MDB_CLOEXEC 0 |
|
|
|
# define MDB_CLOEXEC 0 |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
int fdflags; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#ifdef MDB_USE_SYSV_SEM |
|
|
|
#ifdef MDB_USE_SYSV_SEM |
|
|
|
int semid; |
|
|
|
int semid; |
|
|
@ -4848,10 +4848,10 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl) |
|
|
|
} |
|
|
|
} |
|
|
|
goto fail; |
|
|
|
goto fail; |
|
|
|
} |
|
|
|
} |
|
|
|
#if ! ((MDB_CLOEXEC) || defined(_WIN32)) |
|
|
|
#ifndef _WIN32 |
|
|
|
/* Lose record locks when exec*() */ |
|
|
|
/* Lose record locks when exec*() */ |
|
|
|
if ((fdflags = fcntl(env->me_lfd, F_GETFD) | FD_CLOEXEC) >= 0) |
|
|
|
if (!(MDB_CLOEXEC) && (fdflags = fcntl(env->me_lfd, F_GETFD)) != -1) |
|
|
|
fcntl(env->me_lfd, F_SETFD, fdflags); |
|
|
|
fcntl(env->me_lfd, F_SETFD, fdflags | FD_CLOEXEC); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
if (!(env->me_flags & MDB_NOTLS)) { |
|
|
|
if (!(env->me_flags & MDB_NOTLS)) { |
|
|
|