diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2007-08-09 13:44:36 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2007-08-09 13:44:36 +0000 |
commit | de00dd2a7ea6202c2f154f2e3f4fd54e3cac32cc (patch) | |
tree | c22718da0c2e38b6c072f0d495e90adc027615aa /modules.c | |
parent | 16a59b29b76b6266cfcca3c4aa748f85306b650c (diff) | |
download | rsyslog-de00dd2a7ea6202c2f154f2e3f4fd54e3cac32cc.tar.gz rsyslog-de00dd2a7ea6202c2f154f2e3f4fd54e3cac32cc.tar.xz rsyslog-de00dd2a7ea6202c2f154f2e3f4fd54e3cac32cc.zip |
added module unload functionality; rsyslogd now unloads modules on exit (of
course, with only statically linked modules, there is little current
value in this - but it is made towards an upcoming dynaload plugin
interface)
Diffstat (limited to 'modules.c')
-rw-r--r-- | modules.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -308,6 +308,27 @@ void modPrintList(void) } +/* unload all modules and free module linked list + * rgerhards, 2007-08-09 + */ +rsRetVal modUnloadAndDestructAll(void) +{ + DEFiRet; + modInfo_t *pMod; + modInfo_t *pModPrev; + + pMod = modGetNxt(NULL); + while(pMod != NULL) { + pModPrev = pMod; + pMod = modGetNxt(pModPrev); /* get next */ + /* now we can destroy the previous module */ + dbgprintf("Unloading module %s\n", modGetName(pModPrev)); + modUnload(pModPrev); + moduleDestruct(pModPrev); + } + + return iRet; +} /* * vi:set ai: */ |