X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Ffopen.c;h=03c10cd16c9a3436906b3d25356395719d118e3a;hb=858df113bfac4d2ebb60c3fac1538e07d56096b0;hp=560b77e43cafbf53d69dff50a29491308b4631e6;hpb=400c5e5c8307a2ebe44ef1f203f5a15669f20347;p=musl 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;