summaryrefslogtreecommitdiffstats
path: root/syslogd.c
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 /syslogd.c
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.
Diffstat (limited to 'syslogd.c')
-rw-r--r--syslogd.c27
1 files changed, 17 insertions, 10 deletions
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);