diff options
author | Florian Weimer <fweimer@redhat.com> | 2017-04-18 14:56:51 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2017-04-18 14:56:51 +0200 |
commit | cef9b65376a044309f74b77860ccf3c48a4ae315 (patch) | |
tree | c934a9b57903468b9a2754c1cf8f99f2a94c9269 /sysdeps/posix/getcwd.c | |
parent | b48061e1a534a2421c65e4258418d41a5335ba32 (diff) | |
download | glibc-cef9b65376a044309f74b77860ccf3c48a4ae315.tar glibc-cef9b65376a044309f74b77860ccf3c48a4ae315.tar.gz glibc-cef9b65376a044309f74b77860ccf3c48a4ae315.tar.bz2 glibc-cef9b65376a044309f74b77860ccf3c48a4ae315.zip |
Assume that O_CLOEXEC is always defined and works
Diffstat (limited to 'sysdeps/posix/getcwd.c')
-rw-r--r-- | sysdeps/posix/getcwd.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/sysdeps/posix/getcwd.c b/sysdeps/posix/getcwd.c index 0246e91d7c..eb1706aa5c 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) |