[experimental-ims] 8bf6c6d Also reflect the VCC exit code through if -C is specified.

Poul-Henning Kamp phk at FreeBSD.org
Thu Dec 18 10:27:44 CET 2014


commit 8bf6c6d2891b50b04af463791fc380c359b1d02c
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/mgt_vcc.c b/bin/varnishd/mgt/mgt_vcc.c
index 12433ad..98dc4c4 100644
--- a/bin/varnishd/mgt/mgt_vcc.c
+++ b/bin/varnishd/mgt/mgt_vcc.c
@@ -394,18 +394,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