summaryrefslogtreecommitdiff
path: root/lib/openat.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2020-05-27 20:06:37 +0200
committerBruno Haible <bruno@clisp.org>2020-05-28 21:40:12 +0200
commitb6b450b61ee404f19903a5e2e127c249e5c46d78 (patch)
treef19d9601c11fa989d3876e4c723c1d5913c418d1 /lib/openat.c
parent60ab1089b542c78000ce310f849889b88a44efab (diff)
downloadgnulib-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.c2
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)
{