Commit 3dd6aa06 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Only MGT_Complain() on stderr when -d or -F flags given.

parent 08132c6f
......@@ -176,6 +176,7 @@ extern const char C_INFO[]; // Normal stuff, keep a record for later
extern const char C_DEBUG[]; // More detail than you'd normally want
extern const char C_SECURITY[]; // Security issues
extern const char C_CLI[]; // CLI traffic between master and child
extern int complain_to_stderr;
/* mgt_param.c */
void MCF_InitParams(struct cli *);
......
......@@ -579,6 +579,9 @@ main(int argc, char * const *argv)
if (!d_flag && b_arg == NULL && !f_flag)
ARGV_ERR("Neither -b nor -f given. (use -f '' to override)\n");
if (d_flag || F_flag)
complain_to_stderr = 1;
/*
* Start out by closing all unwanted file descriptors we might
* have inherited from sloppy process control daemons.
......
......@@ -49,6 +49,8 @@
#include "vav.h"
#include "vct.h"
int complain_to_stderr;
/*--------------------------------------------------------------------*/
char *
......@@ -170,7 +172,7 @@ MGT_Complain(const char *loud, const char *fmt, ...)
else
WRONG("Wrong complaint loudness");
if (loud != C_CLI)
if (complain_to_stderr && loud != C_CLI)
fprintf(stderr, "%s %s\n", loud, VSB_data(vsb));
if (!MGT_DO_DEBUG(DBG_VTC_MODE))
......
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