summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-08-07 11:04:14 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-08-07 11:04:14 +0000
commit1cd509518956cd0ad3cfa4c279643a098bc0be2c (patch)
tree00d2f2380f104ed67199cfb4b165b2c96fa25313
parent02ca960691b02f75019a46ba778bb10cf0bdd2e6 (diff)
downloadrsyslog-1cd509518956cd0ad3cfa4c279643a098bc0be2c.tar.gz
rsyslog-1cd509518956cd0ad3cfa4c279643a098bc0be2c.tar.xz
rsyslog-1cd509518956cd0ad3cfa4c279643a098bc0be2c.zip
moved code to create/delete message queue to init(), after reading the conf
file. This is a prequisite to allow specifying the queue size in the conf file.
-rw-r--r--ChangeLog1
-rw-r--r--syslogd.c27
2 files changed, 18 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index e9e3789a..bd6f4390 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@ Version 1.18.1 (rgerhards), 2007-08-??
of rsyslogd on HUP
- applied patch from Michel Samia to fix compilation when the pthreads
feature is disabled
+- some code cleanup (moved action object to its own file set)
---------------------------------------------------------------------------
Version 1.18.0 (rgerhards), 2007-08-03
- rsyslog now supports fallback actions when an action did not work. This
diff --git a/syslogd.c b/syslogd.c
index 2bd3206f..1b0599de 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -4188,6 +4188,15 @@ static void init(void)
dprintf("Clearing templates.\n");
tplDeleteNew();
+
+#ifdef USE_PTHREADS
+ if(pMsgQueue != NULL) {
+ dprintf("deleting message queue\n");
+ queueDelete(pMsgQueue); /* delete fifo here! */
+ pMsgQueue = NULL;
+ }
+#endif
+
/* re-setting values to defaults (where applicable) */
/* TODO: once we have loadable modules, we must re-visit this code. The reason is
@@ -4278,7 +4287,14 @@ static void init(void)
#endif
# ifdef USE_PTHREADS
- startWorker();
+ /* create message queue */
+ pMsgQueue = queueInit();
+ if(pMsgQueue == NULL) {
+ errno = 0;
+ logerror("error: could not create message queue - running single-threaded!\n");
+ }
+
+ startWorker();
# endif
Initialized = 1;
@@ -5806,15 +5822,6 @@ int main(int argc, char **argv)
exit(1); /* "good" exit, leaving at init for fatal error */
}
-#ifdef USE_PTHREADS
- /* create message queue */
- pMsgQueue = queueInit();
- if(pMsgQueue == NULL) {
- errno = 0;
- logerror("error: could not create message queue - running single-threaded!\n");
- }
-#endif
-
if((iRet = loadBuildInModules()) != RS_RET_OK) {
fprintf(stderr, "fatal error: could not activate built-in modules. Error code %d.\n",
iRet);