summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--runtime/debug.c4
-rw-r--r--runtime/debug.h5
-rw-r--r--tools/syslogd.c9
4 files changed, 18 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index bb7228e2..0bae033f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -277,9 +277,13 @@ Version 4.7.0 [v4-devel] (rgerhards), 2009-09-??
- added new config directive $omfileForceChown to (try to) fix some broken
system configs.
See ticket for details: http://bugzilla.adiscon.com/show_bug.cgi?id=150
-- imported changes from 4.5.6 and below
+- added option to use unlimited-size select() calls
+ Thanks to varmjofekoj for the patch
+- debugondemand mode caused backgrounding to fail - close to a bug, but I'd
+ consider the ability to background in this mode a new feature...
+- imported changes from 4.5.7 and below
---------------------------------------------------------------------------
-Version 4.5.7 [v4-beta] (rgerhards), 2009-11-??
+Version 4.5.7 [v4-beta] (rgerhards), 2009-11-18
- added a so-called "On Demand Debug" mode, in which debug output can
be generated only after the process has started, but not right from
the beginning. This is assumed to be useful for hard-to-find bugs.
diff --git a/runtime/debug.c b/runtime/debug.c
index 545ac876..a517b1ba 100644
--- a/runtime/debug.c
+++ b/runtime/debug.c
@@ -1308,11 +1308,11 @@ dbgGetRuntimeOptions(void)
/* this is earlier in the process than the -d option, as such it
* allows us to spit out debug messages from the very beginning.
*/
- Debug = 1;
+ Debug = DEBUG_FULL;
debugging_on = 1;
} else if(!strcasecmp((char*)optname, "debugondemand")) {
/* Enables debugging, but turns off debug output */
- Debug = 1;
+ Debug = DEBUG_ONDEMAND;
debugging_on = 1;
dbgprintf("Note: debug on demand turned on via configuraton file, "
"use USR1 signal to activate.\n");
diff --git a/runtime/debug.h b/runtime/debug.h
index 8d9c1ceb..c011dd2d 100644
--- a/runtime/debug.h
+++ b/runtime/debug.h
@@ -29,6 +29,11 @@
#include <pthread.h>
#include "obj-types.h"
+/* some settings for various debug modes */
+#define DEBUG_OFF 0
+#define DEBUG_ONDEMAND 1
+#define DEBUG_FULL 2
+
/* external static data elements (some time to be replaced) */
extern int Debug; /* debug flag - read-only after startup */
extern int debugging_on; /* read-only, except on sig USR1 */
diff --git a/tools/syslogd.c b/tools/syslogd.c
index d510bc41..2470b6fa 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -569,7 +569,7 @@ logmsgInternal(int iErr, int pri, uchar *msg, int flags)
* permits us to process unmodified config files which otherwise contain a
* supressor statement.
*/
- if(((Debug || NoFork) && bErrMsgToStderr) || iConfigVerify) {
+ if(((Debug == DEBUG_FULL || NoFork) && bErrMsgToStderr) || iConfigVerify) {
if(LOG_PRI(pri) == LOG_ERR)
fprintf(stderr, "rsyslogd: %s\n", msg);
}
@@ -977,9 +977,10 @@ static void doDie(int sig)
static int iRetries = 0; /* debug aid */
dbgprintf(MSG1);
if(Debug)
+ if(Debug == DEBUG_FULL)
write(1, MSG1, sizeof(MSG1) - 1);
if(iRetries++ == 4) {
- if(Debug)
+ if(Debug == DEBUG_FULL)
write(1, MSG2, sizeof(MSG2) - 1);
abort();
}
@@ -2169,7 +2170,7 @@ static rsRetVal mainThread()
* is still in its infancy (and not really done), we currently accept this issue.
* rgerhards, 2009-06-29
*/
- if(!(Debug || NoFork)) {
+ if(!(Debug == DEBUG_FULL || NoFork)) {
close(1);
close(2);
bErrMsgToStderr = 0;
@@ -2361,7 +2362,7 @@ doGlblProcessInit(void)
thrdInit();
- if( !(Debug || NoFork) )
+ if( !(Debug == DEBUG_FULL || NoFork) )
{
DBGPRINTF("Checking pidfile.\n");
if (!check_pid(PidFile))