summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-05-03 18:29:09 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-05-03 18:29:09 +0200
commitb7315fc8369993d462389412b29b132fd2963d72 (patch)
treed453f0114b00a486f3508d014f40286fb5c38a26 /runtime
parentd0d9f823b79c5649dad18cb1d8d7744796ae0907 (diff)
downloadrsyslog-b7315fc8369993d462389412b29b132fd2963d72.tar.gz
rsyslog-b7315fc8369993d462389412b29b132fd2963d72.tar.bz2
rsyslog-b7315fc8369993d462389412b29b132fd2963d72.zip
step: small improvements to input mod config plumbing
Diffstat (limited to 'runtime')
-rw-r--r--runtime/rsconf.c16
-rw-r--r--runtime/rsconf.h1
2 files changed, 11 insertions, 6 deletions
diff --git a/runtime/rsconf.c b/runtime/rsconf.c
index 1e427d42..482622a1 100644
--- a/runtime/rsconf.c
+++ b/runtime/rsconf.c
@@ -375,8 +375,8 @@ runInputModules(void)
BEGINfunc
node = module.GetNxtCnfType(runConf, NULL, eMOD_IN);
while(node != NULL) {
- if(node->pMod->mod.im.bCanRun) {
- /* activate here */
+ if(node->canRun) {
+ DBGPRINTF("running module %s with config %p\n", node->pMod->pszName, node);
bNeedsCancel = (node->pMod->isCompatibleWithFeature(sFEATURENonCancelInputTermination) == RS_RET_OK) ?
0 : 1;
thrdCreate(node->pMod->mod.im.runInput, node->pMod->mod.im.afterRun, bNeedsCancel);
@@ -399,10 +399,14 @@ startInputModules(void)
node = module.GetNxtCnfType(runConf, NULL, eMOD_IN);
while(node != NULL) {
- iRet = node->pMod->mod.im.willRun();
- node->pMod->mod.im.bCanRun = (iRet == RS_RET_OK);
- if(!node->pMod->mod.im.bCanRun) {
- DBGPRINTF("module %lx will not run, iRet %d\n", (unsigned long) node->pMod, iRet);
+ if(node->canActivate) {
+ iRet = node->pMod->mod.im.willRun();
+ node->canRun = (iRet == RS_RET_OK);
+ if(!node->canRun) {
+ DBGPRINTF("module %s will not run, iRet %d\n", node->pMod->pszName, iRet);
+ }
+ } else {
+ node->canRun = 0;
}
node = module.GetNxtCnfType(runConf, node, eMOD_IN);
}
diff --git a/runtime/rsconf.h b/runtime/rsconf.h
index 0718566a..e26b1df6 100644
--- a/runtime/rsconf.h
+++ b/runtime/rsconf.h
@@ -99,6 +99,7 @@ struct cfgmodules_etry_s {
/* the following data is input module specific */
void *modCnf; /* pointer to the input module conf */
sbool canActivate; /* OK to activate this config? */
+ sbool canRun; /* OK to run this config? */
};
struct cfgmodules_s {