X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Fpopen.c;h=ed20f5a1f017c4415303940e435ce61b9caff7b1;hb=b0302863a36ef6ad24bd25e3ef4df74b9a56980d;hp=0c9f24e3062da16aab72a9369a750f94b2c19b75;hpb=44eb4d8b9b7b3b539bcd4e311e9d7c8e2acf8d80;p=musl diff --git a/src/stdio/popen.c b/src/stdio/popen.c index 0c9f24e3..ed20f5a1 100644 --- a/src/stdio/popen.c +++ b/src/stdio/popen.c @@ -1,4 +1,7 @@ #include +#include +#include +#include #include "stdio_impl.h" #include "pthread_impl.h" #include "syscall.h" @@ -38,11 +41,11 @@ FILE *popen(const char *cmd, const char *mode) __acquire_ptc(); pid = __vfork(); - __release_ptc(); if (pid) { + __release_ptc(); __syscall(SYS_close, p[1-op]); - sigprocmask(SIG_BLOCK, SIGALL_SET, &old); + sigprocmask(SIG_SETMASK, &old, 0); if (pid < 0) { fclose(f); return 0;