summaryrefslogtreecommitdiff
path: root/src/stdio/popen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdio/popen.c')
-rw-r--r--src/stdio/popen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdio/popen.c b/src/stdio/popen.c
index 0c9f24e3..5a47509e 100644
--- a/src/stdio/popen.c
+++ b/src/stdio/popen.c
@@ -38,9 +38,9 @@ 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);
if (pid < 0) {