[3.0] 22bc7fc Also reflect the VCC exit code through if -C is specified.

Tollef Fog Heen tfheen at varnish-cache.org
Thu May 24 14:51:12 CEST 2012


commit 22bc7fc6c47558e6e231ba922f183c601b79c620
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Apr 23 16:17:14 2012 +0000

    Also reflect the VCC exit code through if -C is specified.
    
    Fixes #1069

diff --git a/bin/varnishd/mgt_vcc.c b/bin/varnishd/mgt_vcc.c
index 9e204bc..9638783 100644
--- a/bin/varnishd/mgt_vcc.c
+++ b/bin/varnishd/mgt_vcc.c
@@ -390,18 +390,16 @@ mgt_vcc_default(const char *b_arg, const char *f_arg, char *vcl, int C_flag)
 	if (VSB_len(sb) > 0)
 		fprintf(stderr, "%s", VSB_data(sb));
 	VSB_delete(sb);
-	if (C_flag) {
-		if (vf != NULL)
-			AZ(unlink(vf));
-		return (0);
-	}
+	if (C_flag && vf != NULL)
+		AZ(unlink(vf));
 	if (vf == NULL) {
 		fprintf(stderr, "\nVCL compilation failed\n");
 		return (1);
+	} else {
+		vp = mgt_vcc_add(buf, vf);
+		vp->active = 1;
+		return (0);
 	}
-	vp = mgt_vcc_add(buf, vf);
-	vp->active = 1;
-	return (0);
 }
 
 /*--------------------------------------------------------------------*/



More information about the varnish-commit mailing list