fix indention with spaces in powerpc asm
[oweals/musl.git] / src / stdio / popen.c
index 0c9f24e3062da16aab72a9369a750f94b2c19b75..ed20f5a1f017c4415303940e435ce61b9caff7b1 100644 (file)
@@ -1,4 +1,7 @@
 #include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
 #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;