X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Fpclose.c;h=7fb76ed42622f92f2cdb3a8f9ee04bc583d43db8;hb=07809363127dec2e4e9a421219a5eddf05b61592;hp=7c7779663e2dd6c191311e5e2cbf65340b00a7a9;hpb=9799560f79d37fb53d821b2f0b591a6ff260ebc3;p=musl diff --git a/src/stdio/pclose.c b/src/stdio/pclose.c index 7c777966..7fb76ed4 100644 --- a/src/stdio/pclose.c +++ b/src/stdio/pclose.c @@ -1,11 +1,12 @@ #include "stdio_impl.h" +#include "syscall.h" int pclose(FILE *f) { - int status; + int status, r; pid_t pid = f->pipe_pid; fclose(f); - while (waitpid(pid, &status, 0) == -1) - if (errno != EINTR) return -1; + while ((r=__syscall(SYS_wait4, pid, &status, 0, 0)) == -EINTR); + if (r<0) return __syscall_ret(r); return status; }