Commit 65e34661 authored by Federico G. Schwindt's avatar Federico G. Schwindt Committed by Lasse Karstensen

Require -w when running in daemon mode

parent b5d305ee
...@@ -145,6 +145,9 @@ main(int argc, char * const *argv) ...@@ -145,6 +145,9 @@ main(int argc, char * const *argv)
if (optind != argc) if (optind != argc)
usage(1); usage(1);
if (VUT.D_opt && !LOG.w_arg)
VUT_Error(1, "Missing -w option");
/* Setup output */ /* Setup output */
if (LOG.A_opt || !LOG.w_arg) if (LOG.A_opt || !LOG.w_arg)
VUT.dispatch_f = VSL_PrintTransactions; VUT.dispatch_f = VSL_PrintTransactions;
......
...@@ -49,7 +49,8 @@ ...@@ -49,7 +49,8 @@
" receives a SIGHUP the file will be reopened allowing" \ " receives a SIGHUP the file will be reopened allowing" \
" the old one to be rotated away. The file can then be" \ " the old one to be rotated away. The file can then be" \
" read by varnishlog and other tools with the -r option," \ " 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 LOG_OPT_a
......
...@@ -972,6 +972,9 @@ main(int argc, char * const *argv) ...@@ -972,6 +972,9 @@ main(int argc, char * const *argv)
if (optind != argc) if (optind != argc)
usage(1); usage(1);
if (VUT.D_opt && !CTX.w_arg)
VUT_Error(1, "Missing -w option");
/* Check for valid grouping mode */ /* Check for valid grouping mode */
assert(VUT.g_arg < VSL_g__MAX); assert(VUT.g_arg < VSL_g__MAX);
if (VUT.g_arg != VSL_g_vxid && VUT.g_arg != VSL_g_request) if (VUT.g_arg != VSL_g_vxid && VUT.g_arg != VSL_g_request)
......
...@@ -51,7 +51,8 @@ ...@@ -51,7 +51,8 @@
"Redirect output to file. The file will be overwritten" \ "Redirect output to file. The file will be overwritten" \
" unless the -a option was specified. If the application" \ " unless the -a option was specified. If the application" \
" receives a SIGHUP the file will be reopened allowing" \ " 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 NCSA_OPT_a
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment