X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fstdio%2Ffopen.c;h=03c10cd16c9a3436906b3d25356395719d118e3a;hp=0d5b1af25c81f74ffe7b19e2d1dab5d2d6cb3717;hb=f1b23d41cff432a8d0939af427fa005b4a4f95d7;hpb=9bff7c133e73ecfb200614d7a7d386a164a1a61f diff --git a/src/stdio/fopen.c b/src/stdio/fopen.c index 0d5b1af2..03c10cd1 100644 --- a/src/stdio/fopen.c +++ b/src/stdio/fopen.c @@ -1,6 +1,6 @@ #include "stdio_impl.h" -FILE *fopen(const char *filename, const char *mode) +FILE *fopen(const char *restrict filename, const char *restrict mode) { FILE *f; int fd; @@ -17,6 +17,7 @@ FILE *fopen(const char *filename, const char *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;