r1381 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Fri May 4 14:25:23 CEST 2007


Author: phk
Date: 2007-05-04 14:25:23 +0200 (Fri, 04 May 2007)
New Revision: 1381

Modified:
   trunk/varnish-cache/bin/varnishd/mgt_vcc.c
Log:
Fix error reporting with -C


Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_vcc.c	2007-05-03 08:48:51 UTC (rev 1380)
+++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c	2007-05-04 12:25:23 UTC (rev 1381)
@@ -314,15 +314,15 @@
 		AN(buf);
 		if (C_flag) {
 			csrc = VCC_Compile(sb, buf, NULL);
-			fputs(csrc, stdout);
-			return (0);
+			if (csrc != NULL)
+				fputs(csrc, stdout);
 		}
 		vf = mgt_VccCompile(sb, buf, NULL);
 		free(buf);
 	} else if (C_flag) {
 		csrc = VCC_CompileFile(sb, f_arg);
-		fputs(csrc, stdout);
-		return (0);
+		if (csrc != NULL)
+			fputs(csrc, stdout);
 	} else {
 		vf = mgt_VccCompileFile(sb, f_arg);
 	}
@@ -333,6 +333,8 @@
 		return (1);
 	}
 	vsb_delete(sb);
+	if (C_flag)
+		return (0);
 	vp = mgt_vcc_add("boot", vf);
 	vp->active = 1;
 	return (0);




More information about the varnish-commit mailing list