From: des Date: Mon, 30 Jul 2007 14:19:45 +0000 (+0000) Subject: pid_t is not necessarily compatible with int. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=433285097067db0a7c5ceb82230065399b290037;p=varnish pid_t is not necessarily compatible with int. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1788 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/mgt_child.c b/varnish-cache/bin/varnishd/mgt_child.c index 67fc75dc..65813b27 100644 --- a/varnish-cache/bin/varnishd/mgt_child.c +++ b/varnish-cache/bin/varnishd/mgt_child.c @@ -166,7 +166,7 @@ close_sockets(void) static void start_child(void) { - int i; + pid_t pid; unsigned u; char *p; struct ev *e; @@ -185,12 +185,11 @@ start_child(void) 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 @@ start_child(void) 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;