]> err.no Git - varnish/commitdiff
Quench a pointless sigchild warning
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 23 Oct 2007 09:23:04 +0000 (09:23 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 23 Oct 2007 09:23:04 +0000 (09:23 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2157 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/mgt_child.c

index 13e70587c045544e4ab2ff669d6877199ee44ad9..8b9e62d67248818d59153c976fd6ab75bf63df8f 100644 (file)
@@ -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;