kore

An easy to use, scalable and secure web application framework for writing web APIs in C.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

commit d8ff8e2c18169e961a794a6f0f3194f1cfb324ab
parent 445163f7c593b680ddb0b27545e2e465a868b4f6
Author: Joris Vink <joris@coders.se>
Date:   Fri, 17 Jan 2020 21:43:56 +0100

Improve waiting on children to exit.

If waitpid() returns -1 check if errno is ECHILD, just mark the worker
process as exited.

This could happen if Kore starts without keymgr/acme but those would still
be accounted for.

Diffstat:
src/worker.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/worker.c b/src/worker.c @@ -223,8 +223,11 @@ kore_worker_shutdown(void) kw = WORKER(idx); if (kw->pid != 0) { pid = waitpid(kw->pid, &status, 0); - if (pid == -1) + if (pid == -1) { + if (errno == ECHILD) + kw->pid = 0; continue; + } #if defined(__linux__) kore_seccomp_trace(kw->pid, status);