diff options
author | Bruno Haible <bruno@clisp.org> | 2020-05-27 20:06:37 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2020-05-28 21:40:12 +0200 |
commit | b6b450b61ee404f19903a5e2e127c249e5c46d78 (patch) | |
tree | f19d9601c11fa989d3876e4c723c1d5913c418d1 /lib/openat.c | |
parent | 60ab1089b542c78000ce310f849889b88a44efab (diff) | |
download | gnulib-b6b450b61ee404f19903a5e2e127c249e5c46d78.tar.gz |
openat: Make more robust in multithreaded applications.
* lib/openat.c (openat_needs_fchdir): Pass an O_CLOEXEC flag to open().
Diffstat (limited to 'lib/openat.c')
-rw-r--r-- | lib/openat.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/openat.c b/lib/openat.c index fbe1d2e6e6..baf656621d 100644 --- a/lib/openat.c +++ b/lib/openat.c @@ -291,7 +291,7 @@ bool openat_needs_fchdir (void) { bool needs_fchdir = true; - int fd = open ("/", O_SEARCH); + int fd = open ("/", O_SEARCH | O_CLOEXEC); if (0 <= fd) { |