diff options
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) |