From cb4bd3da4722880f69cd53cc8c4fa114259c45c5 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 29 Mar 2016 19:25:28 +0100 Subject: [PATCH] cgi-fcgi-interp: new garbage collection approach, wip compile --- cprogs/cgi-fcgi-interp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cprogs/cgi-fcgi-interp.c b/cprogs/cgi-fcgi-interp.c index 35ce536..99997d0 100644 --- a/cprogs/cgi-fcgi-interp.c +++ b/cprogs/cgi-fcgi-interp.c @@ -581,6 +581,19 @@ static void alarm_handler(int dummy) { queue_alarm(); } +static void child_handler(int dummy) { + for (;;) { + int status; + pid_t got = waitpid(-1, &status, WNOHANG); + if (got == (pid_t)-1) err(127,"(stage2) waitpid"); + if (got != script_child) { + warn("(stage2) waitpid got status %d for unknown child [%lu]", + status, (unsigned long)got); + continue; + } + if (status + + static void setup_handlers(void) { struct sigaction sa; int r; -- 2.30.2