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 --- elf/dl-misc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'elf/dl-misc.c') diff --git a/elf/dl-misc.c b/elf/dl-misc.c index 1e9a6ee..c5d3e0e 100644 --- a/elf/dl-misc.c +++ b/elf/dl-misc.c @@ -45,11 +45,7 @@ _dl_sysdep_read_whole_file (const char *file, size_t *sizep, int prot) { void *result = MAP_FAILED; struct stat64 st; - int flags = O_RDONLY; -#ifdef O_CLOEXEC - flags |= O_CLOEXEC; -#endif - int fd = __open (file, flags); + int fd = __open (file, O_RDONLY | O_CLOEXEC); if (fd >= 0) { if (__fxstat64 (_STAT_VER, fd, &st) >= 0) -- cgit v1.1