diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-10-22 11:41:23 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-10-22 11:41:23 +0200 |
commit | 163acd9d9fd5e01975e99ad26af8a9c8097b3260 (patch) | |
tree | d5901dfca0f2e38ddcf8b973086343ab23a866a1 /tools/syslogd.c | |
parent | bee73d2d93105b187171a1cc51ecf4125b39b65d (diff) | |
parent | 82d0b37dc86385cd239b03da1e57eaba88720589 (diff) | |
download | rsyslog-163acd9d9fd5e01975e99ad26af8a9c8097b3260.tar.gz rsyslog-163acd9d9fd5e01975e99ad26af8a9c8097b3260.tar.bz2 rsyslog-163acd9d9fd5e01975e99ad26af8a9c8097b3260.zip |
Merge branch 'v6-beta' into v6-stable
Diffstat (limited to 'tools/syslogd.c')
-rw-r--r-- | tools/syslogd.c | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c index b158feb3..3bd0f018 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -125,6 +125,7 @@ #include "rsconf.h" #include "dnscache.h" #include "sd-daemon.h" +#include "rainerscript.h" /* definitions for objects we access */ DEFobjCurrIf(obj) @@ -447,7 +448,6 @@ logmsgInternal(int iErr, int pri, uchar *msg, int flags) MsgSetRawMsgWOSize(pMsg, (char*)msg); MsgSetHOSTNAME(pMsg, glbl.GetLocalHostName(), ustrlen(glbl.GetLocalHostName())); MsgSetRcvFrom(pMsg, glbl.GetLocalHostNameProp()); -dbgprintf("ZZZZ: pLocalHostIPIF used!\n"); MsgSetRcvFromIP(pMsg, glbl.GetLocalHostIP()); MsgSetMSGoffs(pMsg, 0); /* check if we have an error code associated and, if so, @@ -801,26 +801,6 @@ static void doDie(int sig) } -/* This function frees all dynamically allocated memory for program termination. - * It must be called only immediately before exit(). It is primarily an aid - * for memory debuggers, which prevents cluttered outupt. - * rgerhards, 2008-03-20 - */ -static void -freeAllDynMemForTermination(void) -{ - free(ourConf->globals.pszConfDAGFile); - struct queuefilenames_s *qfn, *qfnDel; - - for(qfn = queuefilenames ; qfn != NULL ; ) { - qfnDel = qfn; - qfn = qfn->next; - free(qfnDel->name); - free(qfnDel); - } -} - - /* Finalize and destruct all actions. */ static inline void @@ -890,14 +870,16 @@ die(int sig) destructAllActions(); DBGPRINTF("all primary multi-thread sources have been terminated - now doing aux cleanup...\n"); + + DBGPRINTF("destructing current config...\n"); + rsconf.Destruct(&runConf); + /* rger 2005-02-22 * now clean up the in-memory structures. OK, the OS * would also take care of that, but if we do it * ourselfs, this makes finding memory leaks a lot * easier. */ - tplDeleteAll(runConf); - /* de-init some modules */ modExitIminternal(); @@ -921,15 +903,8 @@ die(int sig) /* dbgClassExit MUST be the last one, because it de-inits the debug system */ dbgClassExit(); - /* free all remaining memory blocks - this is not absolutely necessary, but helps - * us keep memory debugger logs clean and this is in aid in developing. It doesn't - * cost much time, so we do it always. -- rgerhards, 2008-03-20 - */ - freeAllDynMemForTermination(); - /* NO CODE HERE - feeelAllDynMemForTermination() must be the last thing before exit()! */ - + /* NO CODE HERE - dbgClassExit() must be the last thing before exit()! */ remove_pid(PidFile); - exit(0); /* "good" exit, this is the terminator function for rsyslog [die()] */ } @@ -1495,6 +1470,7 @@ InitGlobalClasses(void) pErrObj = "net"; CHKiRet(objUse(net, LM_NET_FILENAME)); dnscacheInit(); + initRainerscript(); finalize_it: if(iRet != RS_RET_OK) { |