summaryrefslogtreecommitdiffstats
path: root/runtime/debug.c
diff options
context:
space:
mode:
authorTomas Heinrich <theinric@redhat.com>2012-05-29 11:21:50 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-05-29 11:21:50 +0200
commita4980cbde24b48c5540435d27d01651d5ca46d03 (patch)
treef369293f701bed7f98829e1ead9219ddd1e843e9 /runtime/debug.c
parent131e581845678a30e3dea0e499e78acc429cd5fa (diff)
downloadrsyslog-a4980cbde24b48c5540435d27d01651d5ca46d03.tar.gz
rsyslog-a4980cbde24b48c5540435d27d01651d5ca46d03.tar.xz
rsyslog-a4980cbde24b48c5540435d27d01651d5ca46d03.zip
bugfix: if debug message could end up in log file when forking
if rsyslog was set to auto-background (thus fork, the default) and debug mode to stdout was enabled, debug messages ended up in the first log file opened. Currently, stdout logging is completely disabled in forking mode (but writing to the debug log file is still possible). This is a change in behaviour, which is under review. If it causes problems to you, please let us know. Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
Diffstat (limited to 'runtime/debug.c')
-rw-r--r--runtime/debug.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/runtime/debug.c b/runtime/debug.c
index d02bd516..fa33b99d 100644
--- a/runtime/debug.c
+++ b/runtime/debug.c
@@ -68,7 +68,7 @@ static int bPrintAllDebugOnExit = 0;
static int bAbortTrace = 1; /* print a trace after SIGABRT or SIGSEGV */
static char *pszAltDbgFileName = NULL; /* if set, debug output is *also* sent to here */
static int altdbg = -1; /* and the handle for alternate debug output */
-static int stddbg;
+int stddbg = 1; /* the handle for regular debug output, set to stdout if not forking, -1 otherwise */
/* list of files/objects that should be printed */
typedef struct dbgPrintName_s {
@@ -1297,8 +1297,6 @@ dbgGetRuntimeOptions(void)
uchar *optname;
/* set some defaults */
- stddbg = 1;
-
if((pszOpts = (uchar*) getenv("RSYSLOG_DEBUG")) != NULL) {
/* we have options set, so let's process them */
while(dbgGetRTOptNamVal(&pszOpts, &optname, &optval)) {