summaryrefslogtreecommitdiff
path: root/lib/openat-proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/openat-proc.c')
-rw-r--r--lib/openat-proc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/openat-proc.c b/lib/openat-proc.c
index 6d2b598c8b2..3bacf7dbd13 100644
--- a/lib/openat-proc.c
+++ b/lib/openat-proc.c
@@ -1,10 +1,10 @@
/* Create /proc/self/fd-related names for subfiles of open directories.
- Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
+ the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -73,8 +73,9 @@ openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file)
problem is exhibited on code that built on Solaris 8 and
running on Solaris 10. */
- int proc_self_fd = open ("/proc/self/fd",
- O_SEARCH | O_DIRECTORY | O_NOCTTY | O_NONBLOCK);
+ int proc_self_fd =
+ open ("/proc/self/fd",
+ O_SEARCH | O_DIRECTORY | O_NOCTTY | O_NONBLOCK | O_CLOEXEC);
if (proc_self_fd < 0)
proc_status = -1;
else