summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-rw-r--r--libc/stdio/popen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libc/stdio/popen.c b/libc/stdio/popen.c
index ddf881899..2fd1fa832 100644
--- a/libc/stdio/popen.c
+++ b/libc/stdio/popen.c
@@ -64,7 +64,8 @@ int pclose(FILE *fd)
if (fclose(fd) != 0) {
return EOF;
}
- wait(&waitstat);
+ if (wait(&waitstat) == -1)
+ return -1;
return waitstat;
}