summaryrefslogtreecommitdiffstats
path: root/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/utils.c b/src/utils.c
index 0a98ce0..2d2f615 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -1425,8 +1425,10 @@ int child_wait(int *pfdin, int *pfdout, int pid)
if (pfdout)
close(*pfdout);
- waitpid(pid, &stat, 0);
- return stat;
+ if (waitpid(pid, &stat, 0) == pid)
+ return stat;
+ else
+ return -1;
}
/* Display "Press any key to continue..." and wait for a key press. */