r1784 - in trunk/varnish-cache: bin/varnishd lib/libvarnish

des at projects.linpro.no des at projects.linpro.no
Mon Jul 30 11:49:06 CEST 2007


Author: des
Date: 2007-07-30 11:49:05 +0200 (Mon, 30 Jul 2007)
New Revision: 1784

Modified:
   trunk/varnish-cache/bin/varnishd/mgt_child.c
   trunk/varnish-cache/bin/varnishd/varnishd.c
   trunk/varnish-cache/lib/libvarnish/vpf.c
Log:
Avoid using non-portable <err.h>.


Modified: trunk/varnish-cache/bin/varnishd/mgt_child.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_child.c	2007-07-30 08:03:42 UTC (rev 1783)
+++ trunk/varnish-cache/bin/varnishd/mgt_child.c	2007-07-30 09:49:05 UTC (rev 1784)
@@ -42,8 +42,6 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
-#include <err.h>		/* XXX */
-
 #ifndef HAVE_SETPROCTITLE
 #include "compat/setproctitle.h"
 #endif
@@ -188,8 +186,10 @@
 	AZ(pipe(child_fds));
 	MCF_ParamSync();
 	i = fork();
-	if (i < 0)
-		errx(1, "Could not fork child");
+	if (i < 0) {
+		perror("Could not fork child");
+		exit(1);
+	}
 	if (i == 0) {
 		if (geteuid() == 0) {
 			XXXAZ(setgid(params->gid));

Modified: trunk/varnish-cache/bin/varnishd/varnishd.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/varnishd.c	2007-07-30 08:03:42 UTC (rev 1783)
+++ trunk/varnish-cache/bin/varnishd/varnishd.c	2007-07-30 09:49:05 UTC (rev 1784)
@@ -31,7 +31,8 @@
  * The management process and CLI handling
  */
 
-#include <err.h>
+#include <sys/stat.h>
+
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -44,7 +45,6 @@
 #include <string.h>
 #include <time.h>
 #include <unistd.h>
-#include <sys/stat.h>
 
 #ifndef HAVE_DAEMON
 #include "compat/daemon.h"

Modified: trunk/varnish-cache/lib/libvarnish/vpf.c
===================================================================
--- trunk/varnish-cache/lib/libvarnish/vpf.c	2007-07-30 08:03:42 UTC (rev 1783)
+++ trunk/varnish-cache/lib/libvarnish/vpf.c	2007-07-30 09:49:05 UTC (rev 1784)
@@ -37,7 +37,6 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
-#include <err.h>
 #include <errno.h>
 
 #ifndef HAVE_STRLCPY




More information about the varnish-commit mailing list