r2157 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Tue Oct 23 11:23:04 CEST 2007


Author: phk
Date: 2007-10-23 11:23:04 +0200 (Tue, 23 Oct 2007)
New Revision: 2157

Modified:
   trunk/varnish-cache/bin/varnishd/mgt_child.c
Log:
Quench a pointless sigchild warning


Modified: trunk/varnish-cache/bin/varnishd/mgt_child.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_child.c	2007-10-22 14:38:03 UTC (rev 2156)
+++ trunk/varnish-cache/bin/varnishd/mgt_child.c	2007-10-23 09:23:04 UTC (rev 2157)
@@ -304,14 +304,10 @@
 	}
 	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;
 




More information about the varnish-commit mailing list