From 6dc162e7ee2724cabdcbfc93ccd25f696a83572f Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Wed, 16 Feb 2022 12:32:20 +0100 Subject: [PATCH] Handle ECHILD when reaping workers on shutdown. If the child process is already dead we must handle it accordingly instead of getting stuck waiting on it. --- src/worker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/worker.c b/src/worker.c index 6ea15ca..45cc059 100644 --- a/src/worker.c +++ b/src/worker.c @@ -306,7 +306,7 @@ kore_worker_shutdown(void) if (kw->pid != 0) { pid = waitpid(kw->pid, &status, 0); - if (pid == -1) + if (pid == -1 && errno != ECHILD) continue; #if defined(__linux__)