From: phk Date: Tue, 23 Oct 2007 09:23:04 +0000 (+0000) Subject: Quench a pointless sigchild warning X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0071f9b4559db6b2c184b2134cb396a28b35867;p=varnish Quench a pointless sigchild warning git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2157 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/mgt_child.c b/varnish-cache/bin/varnishd/mgt_child.c index 13e70587..8b9e62d6 100644 --- a/varnish-cache/bin/varnishd/mgt_child.c +++ b/varnish-cache/bin/varnishd/mgt_child.c @@ -304,14 +304,10 @@ mgt_sigchld(const struct ev *e, int what) } ev_poker = NULL; - r = wait4(-1, &status, WNOHANG, NULL); - if (r == 0) + r = wait4(child_pid, &status, WNOHANG, NULL); + if (r == 0 || (r == -1 && errno == ECHILD)) return (0); - if (r != child_pid || r == -1) { - fprintf(stderr, "Unknown child died pid=%d status=0x%x\n", - r, status); - return (0); - } + assert(r == child_pid); fprintf(stderr, "Cache child died pid=%d status=0x%x\n", r, status); child_pid = -1;