[4.0] bda7856 tools: streamline exit codes, fix exit codes for vsubs

Lasse Karstensen lkarsten at varnish-software.com
Mon Sep 22 16:38:24 CEST 2014


commit bda7856dee92b42e86735c4c6888190a7ea4c696
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Thu Aug 28 12:35:33 2014 +0200

    tools: streamline exit codes, fix exit codes for vsubs
    
    This should bring us closer to the exit codes now documented in
    varnishd.rst
    
    Fixes #1572 for tools

diff --git a/bin/varnishlog/varnishlog.c b/bin/varnishlog/varnishlog.c
index 259094e..fbb2f4d 100644
--- a/bin/varnishlog/varnishlog.c
+++ b/bin/varnishlog/varnishlog.c
@@ -82,7 +82,7 @@ openout(int append)
 	else
 		LOG.fo = fopen(LOG.w_arg, append ? "a" : "w");
 	if (LOG.fo == NULL)
-		VUT_Error(1, "Can't open output file (%s)",
+		VUT_Error(2, "Can't open output file (%s)",
 		    LOG.B_opt ? VSL_Error(VUT.vsl) : strerror(errno));
 	VUT.dispatch_priv = LOG.fo;
 }
diff --git a/lib/libvarnishtools/vut.c b/lib/libvarnishtools/vut.c
index d943d8f..50a9f27 100644
--- a/lib/libvarnishtools/vut.c
+++ b/lib/libvarnishtools/vut.c
@@ -159,7 +159,7 @@ VUT_Arg(int opt, const char *arg)
 	case 'V':
 		/* Print version number and exit */
 		VCS_Message(VUT.progname);
-		exit(1);
+		exit(0);
 	default:
 		AN(VUT.vsl);
 		i = VSL_Arg(VUT.vsl, opt, arg);



More information about the varnish-commit mailing list