summaryrefslogtreecommitdiffstats
path: root/runtime/errmsg.c
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/errmsg.c')
-rw-r--r--runtime/errmsg.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/runtime/errmsg.c b/runtime/errmsg.c
index 01d392b7..b555d06a 100644
--- a/runtime/errmsg.c
+++ b/runtime/errmsg.c
@@ -83,7 +83,15 @@ LogError(int __attribute__((unused)) iErrCode, char *fmt, ... )
}
msg[sizeof(msg)/sizeof(char) - 1] = '\0'; /* just to be on the safe side... */
errno = 0;
- logmsgInternal(LOG_SYSLOG|LOG_ERR, msg, ADDDATE);
+
+ /* we must check if the runtime is initialized, because else we can NOT
+ * submit internal errors. -- rgerhards, 2008-04-16
+ * TODO: a better way is to set an error handler and check if it is NULL
+ */
+ if(rsrtIsInit())
+ logmsgInternal(LOG_SYSLOG|LOG_ERR, msg, ADDDATE);
+ else
+ fprintf(stderr, "rsyslog runtime error: %s\n", msg);
ENDfunc
}