Commit 2cb49fa8fb84f3a8fc2eb6036a6bd9b64c57e347

Stefan Sperling 2019-05-10T19:41:58

revert eb73a30f7effc51c1cfee2864102635e3659f87a Not waiting for children can make us blow the fork() ulimit with lingering zombies; the Ctrl-C issue will need some other fix.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/lib/privsep.c b/lib/privsep.c
index 7e6cbb9..1dd3880 100644
--- a/lib/privsep.c
+++ b/lib/privsep.c
@@ -95,8 +95,8 @@ got_privsep_wait_for_child(pid_t pid)
 {
 	int child_status;
 
-	if (waitpid(pid, &child_status, WNOHANG) == 0)
-		return NULL;
+	if (waitpid(pid, &child_status, 0) == -1)
+		return got_error_from_errno();
 
 	if (!WIFEXITED(child_status))
 		return got_error(GOT_ERR_PRIVSEP_DIED);