aboutsummaryrefslogtreecommitdiff
path: root/elf/dl-misc.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 /elf/dl-misc.c
parentb48061e1a534a2421c65e4258418d41a5335ba32 (diff)
downloadglibc-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 'elf/dl-misc.c')
-rw-r--r--elf/dl-misc.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/elf/dl-misc.c b/elf/dl-misc.c
index 1e9a6ee560..c5d3e0e7c5 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)