From: Ian Jackson Date: Tue, 29 Mar 2016 18:25:28 +0000 (+0100) Subject: cgi-fcgi-interp: new garbage collection approach, wip compile X-Git-Tag: archive/debian/5.0.0~52 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=cb4bd3da4722880f69cd53cc8c4fa114259c45c5;p=chiark-utils.git cgi-fcgi-interp: new garbage collection approach, wip compile --- 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;