summaryrefslogtreecommitdiffstats
path: root/modules.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-11-21 16:34:48 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-11-21 16:34:48 +0000
commit3bb7ad8246bca95c89d68a8b0402b8482489c877 (patch)
tree798656b4722649346cbd43a0a328041832666237 /modules.c
parentbb6bfca3dfa6a5d3500e51459b38bb6d0ca6a4b2 (diff)
downloadrsyslog-3bb7ad8246bca95c89d68a8b0402b8482489c877.tar.gz
rsyslog-3bb7ad8246bca95c89d68a8b0402b8482489c877.tar.xz
rsyslog-3bb7ad8246bca95c89d68a8b0402b8482489c877.zip
- added an identifier to command handler table - need to identify which
command handler entries need to be removed when module is unloaded - added support so that linkedlist key can be used for owner handle - enhanced llExecFunc to support deletion of list elements (on behalf of user function being called, slight interface change) - enhanced linkedlist class so that list elements can now be deleted based on the key value they have - created entry point so that CfSysLine handlers are removed on modExit()
Diffstat (limited to 'modules.c')
-rw-r--r--modules.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules.c b/modules.c
index e997eb40..b7ba6dd8 100644
--- a/modules.c
+++ b/modules.c
@@ -184,6 +184,7 @@ modInfo_t *omodGetNxt(modInfo_t *pThis)
static rsRetVal modUnload(modInfo_t *pThis)
{
DEFiRet;
+ void *pModCookie;
assert(pThis != NULL);
@@ -192,7 +193,9 @@ static rsRetVal modUnload(modInfo_t *pThis)
* CVS snapshot, be aware of this limitation. For now, you can just remove everything up to
* (but not including) the END DEVEL comment. That will do the trick. rgerhards, 2007-11-21
*/
-dbgprintf("we are now calling modExit()\n");
+ CHKiRet(pThis->modGetID(&pModCookie));
+dbgprintf("we are now calling modExit(), module id %x\n", pModCookie);
+ CHKiRet(unregCfSysLineHdlrs4Owner(pModCookie));
/* END DEVEL */
@@ -283,6 +286,10 @@ rsRetVal doModInit(rsRetVal (*modInit)(int, int*, rsRetVal(**)(), rsRetVal(*)())
moduleDestruct(pNew);
return iRet;
}
+ if((iRet = (*pNew->modQueryEtryPt)((uchar*)"modGetID", &pNew->modGetID)) != RS_RET_OK) {
+ moduleDestruct(pNew);
+ return iRet;
+ }
if((iRet = (*pNew->modQueryEtryPt)((uchar*)"modExit", &pNew->modExit)) != RS_RET_OK) {
moduleDestruct(pNew);
return iRet;