diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2011-05-06 08:43:15 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2011-05-06 08:43:15 +0200 |
commit | b056c258d7bab528034ec8c8749cdcf0d0102268 (patch) | |
tree | e3b19d5336e0db8ad23fcaf82d3142f8844d54ac /runtime/rsconf.c | |
parent | c0d1334f6e23b1cfb21d302e3a4b32c449c26547 (diff) | |
download | rsyslog-b056c258d7bab528034ec8c8749cdcf0d0102268.tar.gz rsyslog-b056c258d7bab528034ec8c8749cdcf0d0102268.tar.bz2 rsyslog-b056c258d7bab528034ec8c8749cdcf0d0102268.zip |
step: generalized new config interface for all module types
Diffstat (limited to 'runtime/rsconf.c')
-rw-r--r-- | runtime/rsconf.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/runtime/rsconf.c b/runtime/rsconf.c index 8fc30cf3..92c17b5c 100644 --- a/runtime/rsconf.c +++ b/runtime/rsconf.c @@ -301,10 +301,11 @@ tellInputsConfigLoadDone(void) cfgmodules_etry_t *node; BEGINfunc - DBGPRINTF("telling inputs that config load for %p is done\n", loadConf); - node = module.GetNxtCnfType(loadConf, NULL, eMOD_IN); + DBGPRINTF("telling modules that config load for %p is done\n", loadConf); + node = module.GetNxtCnfType(loadConf, NULL, eMOD_ANY); while(node != NULL) { - node->pMod->mod.im.endCnfLoad(node->modCnf); + if(node->pMod->beginCnfLoad != NULL) + node->pMod->endCnfLoad(node->modCnf); node = module.GetNxtCnfType(runConf, node, eMOD_IN); } @@ -321,16 +322,18 @@ tellInputsCheckConfig(void) rsRetVal localRet; BEGINfunc - DBGPRINTF("telling inputs to check config %p\n", loadConf); - node = module.GetNxtCnfType(loadConf, NULL, eMOD_IN); + DBGPRINTF("telling modules to check config %p\n", loadConf); + node = module.GetNxtCnfType(loadConf, NULL, eMOD_ANY); while(node != NULL) { - localRet = node->pMod->mod.im.checkCnf(node->modCnf); - DBGPRINTF("module %s tells us config can %sbe activated\n", - node->pMod->pszName, (localRet == RS_RET_OK) ? "" : "NOT "); - if(localRet == RS_RET_OK) { - node->canActivate = 1; - } else { - node->canActivate = 0; + if(node->pMod->beginCnfLoad != NULL) { + localRet = node->pMod->checkCnf(node->modCnf); + DBGPRINTF("module %s tells us config can %sbe activated\n", + node->pMod->pszName, (localRet == RS_RET_OK) ? "" : "NOT "); + if(localRet == RS_RET_OK) { + node->canActivate = 1; + } else { + node->canActivate = 0; + } } node = module.GetNxtCnfType(runConf, node, eMOD_IN); } @@ -348,13 +351,13 @@ tellInputsActivateConfig(void) rsRetVal localRet; BEGINfunc - DBGPRINTF("telling inputs to activate config %p\n", runConf); - node = module.GetNxtCnfType(runConf, NULL, eMOD_IN); + DBGPRINTF("telling modules to activate config %p\n", runConf); + node = module.GetNxtCnfType(runConf, NULL, eMOD_ANY); while(node != NULL) { - if(node->canActivate) { + if(node->pMod->beginCnfLoad != NULL && node->canActivate) { DBGPRINTF("activating config %p for module %s\n", runConf, node->pMod->pszName); - localRet = node->pMod->mod.im.activateCnf(node->modCnf); + localRet = node->pMod->activateCnf(node->modCnf); if(localRet != RS_RET_OK) { errmsg.LogError(0, localRet, "activation of module %s failed", node->pMod->pszName); |