From cef9b65376a044309f74b77860ccf3c48a4ae315 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Tue, 18 Apr 2017 14:56:51 +0200 Subject: Assume that O_CLOEXEC is always defined and works --- sysdeps/posix/getcwd.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'sysdeps/posix/getcwd.c') 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) -- cgit v1.2.3-70-g09d2