diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-09-18 12:19:33 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-09-18 12:19:33 +0200 |
commit | 4c96ebdcfe075e80810b01257cf21ea1c9b3ec0e (patch) | |
tree | b6768398d8d55c04e045b5213e11b952484025e8 /tools/syslogd.c | |
parent | 988989e49ef8639123c83383ba256c4e67679c8d (diff) | |
download | rsyslog-4c96ebdcfe075e80810b01257cf21ea1c9b3ec0e.tar.gz rsyslog-4c96ebdcfe075e80810b01257cf21ea1c9b3ec0e.tar.bz2 rsyslog-4c96ebdcfe075e80810b01257cf21ea1c9b3ec0e.zip |
bugfix: potential race condition when adding messages to queue
There was a wrong order of mutex lock operations. It is hard to
believe that really caused problems, but in theory it could and with
threading we often see that theory becomes practice if something is only
used long enough on a fast enough machine with enough CPUs ;)
Diffstat (limited to 'tools/syslogd.c')
-rw-r--r-- | tools/syslogd.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c index b6e1d826..3a637dd8 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -2832,9 +2832,8 @@ static rsRetVal mainThread() CHKiRet(init()); - if(Debug) { + if(Debug && debugging_on) { dbgprintf("Debugging enabled, SIGUSR1 to turn off debugging.\n"); - debugging_on = 1; } /* Send a signal to the parent so it can terminate. */ @@ -3082,9 +3081,9 @@ doGlblProcessInit(void) fputs(" Already running.\n", stderr); exit(1); /* "good" exit, done if syslogd is already running */ } - } - else + } else { debugging_on = 1; + } /* tuck my process id away */ dbgprintf("Writing pidfile %s.\n", PidFile); |