From a06fca85da281c34b4ba6185d04c8b8ec16f1390 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 22 Jul 2007 18:37:10 +0000 Subject: [PATCH] (_IO_new_file_fopen): Recognize 'e' flag and set O_CLOEXEC is needed. this is a widely supported non-standard flag for fopen. Change-Id: I58bae7535cfdb7dae419534179fe2e6256ec8d35 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3801 Reviewed-by: Adrien Destugues --- src/system/libroot/posix/glibc/libio/fileops.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/system/libroot/posix/glibc/libio/fileops.c b/src/system/libroot/posix/glibc/libio/fileops.c index 3dbcbb0c9a..b83ea03139 100644 --- a/src/system/libroot/posix/glibc/libio/fileops.c +++ b/src/system/libroot/posix/glibc/libio/fileops.c @@ -303,6 +303,11 @@ _IO_new_file_fopen(_IO_FILE *fp, const char *filename, const char *mode, int is3 case 'm': fp->_flags2 |= _IO_FLAGS2_MMAP; continue; +#ifdef O_CLOEXEC + case 'e': + oflags |= O_CLOEXEC; + continue; +#endif default: /* Ignore. */ continue;