r3095 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Fri Aug 15 10:30:49 CEST 2008


Author: phk
Date: 2008-08-15 10:30:49 +0200 (Fri, 15 Aug 2008)
New Revision: 3095

Modified:
   trunk/varnish-cache/bin/varnishd/mgt_vcc.c
Log:
Accept EINTR from waitpid()



Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_vcc.c	2008-08-14 20:10:29 UTC (rev 3094)
+++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c	2008-08-15 08:30:49 UTC (rev 3095)
@@ -143,7 +143,7 @@
 	char sf[] = "./vcl.########.c";
 	char of[sizeof sf + 1];
 	char *retval;
-	int p[2], sfd, srclen, status;
+	int rv, p[2], sfd, srclen, status;
 	pid_t pid;
 	void *dlh;
 	struct vlu *vlu;
@@ -213,12 +213,15 @@
 	AZ(close(p[0]));
 	VLU_Destroy(vlu);
 	(void)unlink(sf);
-	if (waitpid(pid, &status, 0) < 0) {
-		vsb_printf(sb, "%s(): waitpid() failed: %s",
-		    __func__, strerror(errno));
-		(void)unlink(of);
-		return (NULL);
-	}
+	do {
+		rv = waitpid(pid, &status, 0);
+		if (rv < 0 && errno != EINTR) {
+			vsb_printf(sb, "%s(): waitpid() failed: %s",
+			    __func__, strerror(errno));
+			(void)unlink(of);
+			return (NULL);
+		}
+	} while (rv < 0);
 	if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
 		vsb_printf(sb, "%s(): Compiler failed", __func__);
 		if (WIFEXITED(status))




More information about the varnish-commit mailing list