aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/posix/getcwd.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2017-04-18 14:56:51 +0200
committerFlorian Weimer <fweimer@redhat.com>2017-04-18 14:56:51 +0200
commitcef9b65376a044309f74b77860ccf3c48a4ae315 (patch)
treec934a9b57903468b9a2754c1cf8f99f2a94c9269 /sysdeps/posix/getcwd.c
parentb48061e1a534a2421c65e4258418d41a5335ba32 (diff)
downloadglibc-cef9b65376a044309f74b77860ccf3c48a4ae315.zip
glibc-cef9b65376a044309f74b77860ccf3c48a4ae315.tar.gz
glibc-cef9b65376a044309f74b77860ccf3c48a4ae315.tar.bz2
Assume that O_CLOEXEC is always defined and works
Diffstat (limited to 'sysdeps/posix/getcwd.c')
-rw-r--r--sysdeps/posix/getcwd.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/sysdeps/posix/getcwd.c b/sysdeps/posix/getcwd.c
index 0246e91..eb1706a 100644
--- a/sysdeps/posix/getcwd.c
+++ b/sysdeps/posix/getcwd.c
@@ -281,13 +281,7 @@ __getcwd (char *buf, size_t size)
while (!(thisdev == rootdev && thisino == rootino))
{
if (__have_atfcts >= 0)
- {
- int mode = O_RDONLY;
-#ifdef O_CLOEXEC
- mode |= O_CLOEXEC;
-#endif
- fd = openat64_not_cancel_3 (fd, "..", mode);
- }
+ fd = openat64_not_cancel_3 (fd, "..", O_RDONLY | O_CLOEXEC);
else
fd = -1;
if (fd >= 0)