summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-07-24 16:27:01 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-07-24 16:27:01 +0000
commitb6854528e79a94c6604fac6c9ad31b307d9968fe (patch)
treede5ec35efe2ba8cd3811a44295778e160da546a6
parent989d0ed8581de3cb5b6b8ed7a1aa25708638cbb3 (diff)
downloadrsyslog-b6854528e79a94c6604fac6c9ad31b307d9968fe.tar.gz
rsyslog-b6854528e79a94c6604fac6c9ad31b307d9968fe.tar.xz
rsyslog-b6854528e79a94c6604fac6c9ad31b307d9968fe.zip
hardned syslogd for a very unusual low memory condition
-rw-r--r--syslogd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/syslogd.c b/syslogd.c
index 1d9bd825..de588412 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -2317,7 +2317,7 @@ static void processMsg(msg_t *pMsg)
/* log the message to the particular outputs */
if (!Initialized) {
- fprintf(stderr, "%s\n", pMsg->pszMSG);
+ fprintf(stderr, "rsyslog: %s\n", pMsg->pszMSG);
return;
#if 0 /* TODO: I temporarily disable the emergency logging system. We must re-think
* how this is done, as we now have modules.
@@ -4289,7 +4289,12 @@ static void init()
/* allocate next entry and add it */
f = (selector_t *)calloc(1, sizeof(selector_t));
- /* TODO: check for NULL pointer (this is a general issue in this code...)! */
+ if(f == NULL) {
+ /* this time, it looks like we really have no point in continuing to run... */
+ logerror("fatal: could not allocated selector\n");
+ exit(1); /* TODO: think about it, maybe we can avoid */
+ }
+
/* be careful: the default below must be set BEFORE calling cfline()! */
f->f_un.f_file.f_sizeLimit = 0; /* default value, use outchannels to configure! */