[master] b8f55d9 Require -w when running in daemon mode

Federico G. Schwindt fgsch at lodoss.net
Mon Oct 26 16:52:05 CET 2015


commit b8f55d90d085da59b69ca5185818ea83e284552b
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Mon Oct 26 13:50:15 2015 +0000

    Require -w when running in daemon mode

diff --git a/bin/varnishlog/varnishlog.c b/bin/varnishlog/varnishlog.c
index 3b5061f..8e600b5 100644
--- a/bin/varnishlog/varnishlog.c
+++ b/bin/varnishlog/varnishlog.c
@@ -145,6 +145,9 @@ main(int argc, char * const *argv)
 	if (optind != argc)
 		usage(1);
 
+	if (VUT.D_opt && !LOG.w_arg)
+		VUT_Error(1, "Missing -w option");
+
 	/* Setup output */
 	if (LOG.A_opt || !LOG.w_arg)
 		VUT.dispatch_f = VSL_PrintTransactions;
diff --git a/bin/varnishlog/varnishlog_options.h b/bin/varnishlog/varnishlog_options.h
index 187ac57..ed62abd 100644
--- a/bin/varnishlog/varnishlog_options.h
+++ b/bin/varnishlog/varnishlog_options.h
@@ -49,7 +49,8 @@
 	    " receives a SIGHUP the file will be reopened allowing"	\
 	    " the old one to be rotated away. The file can then be"	\
 	    " read by varnishlog and other tools with the -r option,"   \
-	    " unless the -A option was specified."			\
+	    " unless the -A option was specified. This option is"	\
+	    " required when running in daemon mode."			\
 	)
 
 LOG_OPT_a
diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c
index 77e6354..2ee2137 100644
--- a/bin/varnishncsa/varnishncsa.c
+++ b/bin/varnishncsa/varnishncsa.c
@@ -972,6 +972,9 @@ main(int argc, char * const *argv)
 	if (optind != argc)
 		usage(1);
 
+	if (VUT.D_opt && !CTX.w_arg)
+		VUT_Error(1, "Missing -w option");
+
 	/* Check for valid grouping mode */
 	assert(VUT.g_arg < VSL_g__MAX);
 	if (VUT.g_arg != VSL_g_vxid && VUT.g_arg != VSL_g_request)
diff --git a/bin/varnishncsa/varnishncsa_options.h b/bin/varnishncsa/varnishncsa_options.h
index edb5a39..87075cc 100644
--- a/bin/varnishncsa/varnishncsa_options.h
+++ b/bin/varnishncsa/varnishncsa_options.h
@@ -51,7 +51,8 @@
 	    "Redirect output to file. The file will be overwritten"	\
 	    " unless the -a option was specified. If the application"	\
 	    " receives a SIGHUP the file will be reopened allowing"	\
-	    " the old one to be rotated away."				\
+	    " the old one to be rotated away. This option is required"	\
+	    " when running in daemon mode."				\
 	)
 
 NCSA_OPT_a



More information about the varnish-commit mailing list