summaryrefslogtreecommitdiff
path: root/src/stdio/fopen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdio/fopen.c')
-rw-r--r--src/stdio/fopen.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/stdio/fopen.c b/src/stdio/fopen.c
index 560b77e4..03c10cd1 100644
--- a/src/stdio/fopen.c
+++ b/src/stdio/fopen.c
@@ -17,6 +17,7 @@ FILE *fopen(const char *restrict filename, const char *restrict mode)
else if (*mode == 'r') flags = O_RDONLY;
else flags = O_WRONLY;
if (strchr(mode, 'x')) flags |= O_EXCL;
+ if (strchr(mode, 'e')) flags |= O_CLOEXEC;
if (*mode != 'r') flags |= O_CREAT;
if (*mode == 'w') flags |= O_TRUNC;
if (*mode == 'a') flags |= O_APPEND;