X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Ffopen.c;h=252f08241b3a313c057b3c6d8fc6baa1e8278c43;hb=3ca2d2d4aef910663785fe232d7d2127a22d8a84;hp=da17ce8b48dc431d6aa70539bbb136841e8f727d;hpb=835f9f950e2f6059532bd9ab9857a856ed21a4fd;p=musl diff --git a/src/stdio/fopen.c b/src/stdio/fopen.c index da17ce8b..252f0824 100644 --- a/src/stdio/fopen.c +++ b/src/stdio/fopen.c @@ -18,8 +18,10 @@ FILE *fopen(const char *restrict filename, const char *restrict mode) /* Compute the flags to pass to open() */ flags = __fmodeflags(mode); - fd = syscall_cp(SYS_open, filename, flags|O_LARGEFILE, 0666); + fd = sys_open(filename, flags, 0666); if (fd < 0) return 0; + if (flags & O_CLOEXEC) + __syscall(SYS_fcntl, fd, F_SETFD, FD_CLOEXEC); f = __fdopen(fd, mode); if (f) return f;