r1788 - trunk/varnish-cache/bin/varnishd

des at projects.linpro.no des at projects.linpro.no
Mon Jul 30 16:19:45 CEST 2007


Author: des
Date: 2007-07-30 16:19:45 +0200 (Mon, 30 Jul 2007)
New Revision: 1788

Modified:
   trunk/varnish-cache/bin/varnishd/mgt_child.c
Log:
pid_t is not necessarily compatible with int.


Modified: trunk/varnish-cache/bin/varnishd/mgt_child.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_child.c	2007-07-30 14:16:23 UTC (rev 1787)
+++ trunk/varnish-cache/bin/varnishd/mgt_child.c	2007-07-30 14:19:45 UTC (rev 1788)
@@ -166,7 +166,7 @@
 static void
 start_child(void)
 {
-	int i;
+	pid_t pid;
 	unsigned u;
 	char *p;
 	struct ev *e;
@@ -185,12 +185,11 @@
 	AZ(pipe(&heritage.fds[2]));
 	AZ(pipe(child_fds));
 	MCF_ParamSync();
-	i = fork();
-	if (i < 0) {
+	if ((pid = fork()) < 0) {
 		perror("Could not fork child");
 		exit(1);
 	}
-	if (i == 0) {
+	if (pid == 0) {
 		if (geteuid() == 0) {
 			XXXAZ(setgid(params->gid));
 			XXXAZ(setuid(params->uid));
@@ -217,7 +216,7 @@
 		exit (1);
 	}
 
-	fprintf(stderr, "start child pid %d\n", i);
+	fprintf(stderr, "start child pid %jd\n", (intmax_t)pid);
 
 	AZ(close(child_fds[1]));
 	child_fds[1] = -1;




More information about the varnish-commit mailing list