summaryrefslogtreecommitdiffstats
path: root/tools/syslogd.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-09-26 13:40:41 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-09-26 13:40:41 +0200
commitdc44f5a475101aa18568a0eaceacc2a4eb718391 (patch)
tree53d4e7ba7a4b25cda39a756e0be3aff9e0734436 /tools/syslogd.c
parent47a2593ae4e2d4077b4a9e8c77a2b686abfa8d2c (diff)
downloadrsyslog-dc44f5a475101aa18568a0eaceacc2a4eb718391.tar.gz
rsyslog-dc44f5a475101aa18568a0eaceacc2a4eb718391.tar.xz
rsyslog-dc44f5a475101aa18568a0eaceacc2a4eb718391.zip
cleaned up internal debug system code and made it behave better in regard to multi-threading
Diffstat (limited to 'tools/syslogd.c')
-rw-r--r--tools/syslogd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 3a637dd8..a39f5a5c 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -1871,16 +1871,22 @@ void legacyOptsParseTCP(char ch, char *arg)
* a minimal delay, but it is much cleaner than the approach of doing everything
* inside the signal handler.
* rgerhards, 2005-10-26
+ * Note: we do not call dbgprintf() as this may cause us to block in case something
+ * with the threading is wrong.
*/
static void doDie(int sig)
{
+# define MSG1 "DoDie called.\n"
+# define MSG2 "DoDie called 5 times - unconditional exit\n"
static int iRetries = 0; /* debug aid */
- printf("DoDie called.\n");
+ write(1, MSG1, sizeof(MSG1));
if(iRetries++ == 4) {
- printf("DoDie called 5 times - unconditional exit\n");
+ write(1, MSG2, sizeof(MSG2));
abort();
}
bFinished = sig;
+# undef MSG1
+# undef MSG2
}