r4546 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Wed Feb 10 12:00:35 CET 2010


Author: phk
Date: 2010-02-10 12:00:35 +0100 (Wed, 10 Feb 2010)
New Revision: 4546

Modified:
   trunk/varnish-cache/bin/varnishd/shmlog.c
Log:
Don't stumble over zero pid fields.



Modified: trunk/varnish-cache/bin/varnishd/shmlog.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/shmlog.c	2010-02-10 10:44:14 UTC (rev 4545)
+++ trunk/varnish-cache/bin/varnishd/shmlog.c	2010-02-10 11:00:35 UTC (rev 4546)
@@ -336,7 +336,7 @@
 	if (slh.start != sizeof slh + sizeof *params)
 		return (0);
 
-	if (!kill(slh.master_pid, 0)) {
+	if (slh.master_pid != 0 && !kill(slh.master_pid, 0)) {
 		fprintf(stderr,
 		    "SHMFILE owned by running varnishd master (pid=%jd)\n",
 		    (intmax_t)slh.master_pid);



More information about the varnish-commit mailing list