diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2007-11-21 16:34:48 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2007-11-21 16:34:48 +0000 |
commit | 3bb7ad8246bca95c89d68a8b0402b8482489c877 (patch) | |
tree | 798656b4722649346cbd43a0a328041832666237 /modules.c | |
parent | bb6bfca3dfa6a5d3500e51459b38bb6d0ca6a4b2 (diff) | |
download | rsyslog-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.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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; |