Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
e674f824
Commit
e674f824
authored
Sep 06, 2016
by
Hallvard Furuseth
Browse files
Clean up strange fcntl result check
...and check !MDB_CLOEXEC in an 'if' rather than '#if' to match its non-zero usage.
parent
bffe2ebc
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/liblmdb/mdb.c
View file @
e674f824
...
...
@@ -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
))
#if
ndef
_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
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment