From: phk Date: Mon, 27 Mar 2006 13:59:09 +0000 (+0000) Subject: Just return if there is nothing to wait for. We get SIGCHLD'ed on X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2d614ca59a34e6ffe6672bc6b9d47f5c2ffa0f3;p=varnish Just return if there is nothing to wait for. We get SIGCHLD'ed on the popen child process. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@80 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/mgt_child.c b/varnish-cache/bin/varnishd/mgt_child.c index af4d226f..a581fc78 100644 --- a/varnish-cache/bin/varnishd/mgt_child.c +++ b/varnish-cache/bin/varnishd/mgt_child.c @@ -188,7 +188,7 @@ child_pingpong(int a, short b, void *c) time(&t); mgt_child_request(child_pingpong_ccb, NULL, NULL, "ping %ld", t); if (1) { - tv.tv_sec = 3; + tv.tv_sec = 30; tv.tv_usec = 0; evtimer_del(&ev_child_pingpong); evtimer_add(&ev_child_pingpong, &tv); @@ -284,6 +284,8 @@ mgt_sigchld(int a, short b, void *c) printf("sig_chld(%d, %d, %p)\n", a, b, c); p = wait4(-1, &status, WNOHANG, NULL); + if (p == 0) + return; printf("pid = %d status = 0x%x\n", p, status); assert(p == child_pid);