summaryrefslogtreecommitdiffstats
path: root/modules.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-08-14 07:57:15 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-08-14 07:57:15 +0000
commit4884ef844c8f5c4c6e61fca17a3edeca95cdb03c (patch)
treeef78b2ea8e93ee4022377c0871d7108d414d30dc /modules.c
parent602ef197d3f54f360cf44fb7b95e2d45f42606b1 (diff)
downloadrsyslog-4884ef844c8f5c4c6e61fca17a3edeca95cdb03c.tar.gz
rsyslog-4884ef844c8f5c4c6e61fca17a3edeca95cdb03c.tar.xz
rsyslog-4884ef844c8f5c4c6e61fca17a3edeca95cdb03c.zip
- integrated patch from varmojfekoj to make the mysql module a loadable one
many thanks for the patch, MUCH appreciated
Diffstat (limited to 'modules.c')
-rw-r--r--modules.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/modules.c b/modules.c
index 5ecceecd..da57a282 100644
--- a/modules.c
+++ b/modules.c
@@ -69,6 +69,8 @@ static void moduleDestruct(modInfo_t *pThis)
{
if(pThis->pszName != NULL)
free(pThis->pszName);
+ if(pThis->pModHdlr != NULL)
+ dlclose(pThis->pModHdlr);
free(pThis);
}
@@ -192,7 +194,7 @@ finalize_it:
/* Add an already-loaded module to the module linked list. This function does
* everything needed to fully initialize the module.
*/
-rsRetVal doModInit(rsRetVal (*modInit)(int, int*, rsRetVal(**)(), rsRetVal(*)()), uchar *name)
+rsRetVal doModInit(rsRetVal (*modInit)(int, int*, rsRetVal(**)(), rsRetVal(*)()), uchar *name, void *pModHdlr)
{
DEFiRet;
modInfo_t *pNew;
@@ -261,8 +263,13 @@ rsRetVal doModInit(rsRetVal (*modInit)(int, int*, rsRetVal(**)(), rsRetVal(*)())
}
pNew->pszName = (uchar*) strdup((char*)name); /* we do not care if strdup() fails, we can accept that */
+ pNew->pModHdlr = pModHdlr;
pNew->eType = eMOD_OUT; /* TODO: take this from module */
- pNew->eLinkType = eMOD_LINK_STATIC; /* TODO: take this from module */
+ /* TODO: take this from module */
+ if(pModHdlr == NULL)
+ pNew->eLinkType = eMOD_LINK_STATIC;
+ else
+ pNew->eLinkType = eMOD_LINK_DYNAMIC_LOADED;
/* we initialized the structure, now let's add it to the linked list of modules */
addModToList(pNew);