diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2011-05-04 14:41:08 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2011-05-04 14:41:08 +0200 |
commit | 79d46017e49d39b5de2d783cc3bcbeb696535bfc (patch) | |
tree | 640cf7d51a20d2479e2057694b4baddc8d33274c /runtime | |
parent | b7315fc8369993d462389412b29b132fd2963d72 (diff) | |
download | rsyslog-79d46017e49d39b5de2d783cc3bcbeb696535bfc.tar.gz rsyslog-79d46017e49d39b5de2d783cc3bcbeb696535bfc.tar.xz rsyslog-79d46017e49d39b5de2d783cc3bcbeb696535bfc.zip |
step: imudp utilizes interim new input module interface
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/module-template.h | 2 | ||||
-rw-r--r-- | runtime/modules.c | 2 | ||||
-rw-r--r-- | runtime/modules.h | 2 | ||||
-rw-r--r-- | runtime/rsconf.c | 8 | ||||
-rw-r--r-- | runtime/rsyslog.h | 1 |
5 files changed, 11 insertions, 4 deletions
diff --git a/runtime/module-template.h b/runtime/module-template.h index 1ec1d8d2..38cda4ba 100644 --- a/runtime/module-template.h +++ b/runtime/module-template.h @@ -616,7 +616,7 @@ static rsRetVal modExit(void)\ * the module. -- rgerards, 2011-05-03 */ #define BEGINbeginCnfLoad \ -static rsRetVal beginCnfLoad(modConfData_t **ptr)\ +static rsRetVal beginCnfLoad(modConfData_t **ptr, rsconf_t *pConf)\ {\ modConfData_t *pModConf; \ DEFiRet; diff --git a/runtime/modules.c b/runtime/modules.c index 67f16e65..e2e12a3b 100644 --- a/runtime/modules.c +++ b/runtime/modules.c @@ -372,7 +372,7 @@ addModToCnfList(modInfo_t *pThis) pNew->pMod = pThis; if(pThis->eType == eMOD_IN) { - CHKiRet(pThis->mod.im.beginCnfLoad(&pNew->modCnf)); + CHKiRet(pThis->mod.im.beginCnfLoad(&pNew->modCnf, loadConf)); } if(pLast == NULL) { diff --git a/runtime/modules.h b/runtime/modules.h index 759e3350..45fffdad 100644 --- a/runtime/modules.h +++ b/runtime/modules.h @@ -116,7 +116,7 @@ struct modInfo_s { rsRetVal (*createInstance)(); union { struct {/* data for input modules */ - rsRetVal (*beginCnfLoad)(void*newCnf); + rsRetVal (*beginCnfLoad)(void*newCnf, rsconf_t *pConf); rsRetVal (*endCnfLoad)(void*Cnf); rsRetVal (*checkCnf)(void*Cnf); rsRetVal (*activateCnf)(void*Cnf); /* make provided config the running conf */ diff --git a/runtime/rsconf.c b/runtime/rsconf.c index 482622a1..8fc30cf3 100644 --- a/runtime/rsconf.c +++ b/runtime/rsconf.c @@ -345,6 +345,7 @@ static rsRetVal tellInputsActivateConfig(void) { cfgmodules_etry_t *node; + rsRetVal localRet; BEGINfunc DBGPRINTF("telling inputs to activate config %p\n", runConf); @@ -353,7 +354,12 @@ tellInputsActivateConfig(void) if(node->canActivate) { DBGPRINTF("activating config %p for module %s\n", runConf, node->pMod->pszName); - node->pMod->mod.im.activateCnf(node->modCnf); + localRet = node->pMod->mod.im.activateCnf(node->modCnf); + if(localRet != RS_RET_OK) { + errmsg.LogError(0, localRet, "activation of module %s failed", + node->pMod->pszName); + node->canActivate = 0; /* in a sense, could not activate... */ + } } node = module.GetNxtCnfType(runConf, node, eMOD_IN); } diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h index fcc0d626..fbcdc253 100644 --- a/runtime/rsyslog.h +++ b/runtime/rsyslog.h @@ -355,6 +355,7 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth RS_RET_ERR_LIBLOGNORM_INIT = -2202,/**< cannot obtain liblognorm ctx */ RS_RET_ERR_LIBLOGNORM_SAMPDB_LOAD = -2203,/**< liblognorm sampledb load failed */ RS_RET_CMD_GONE_AWAY = -2204,/**< config directive existed, but no longer supported */ + RS_RET_ERR_SCHED_PARAMS = -2205,/**< there is a problem with configured thread scheduling params */ /* RainerScript error messages (range 1000.. 1999) */ RS_RET_SYSVAR_NOT_FOUND = 1001, /**< system variable could not be found (maybe misspelled) */ |