summaryrefslogtreecommitdiffstats
path: root/cfsysline.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-08-01 09:57:02 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-08-01 09:57:02 +0000
commitbec7683ec23befea56d885bc18e7e0fdc6fdf08b (patch)
tree62007690114b8dde08639c1e9e71e592756a0646 /cfsysline.c
parent6c305fdc9a635e03727b19425318ce2eab924c0b (diff)
downloadrsyslog-bec7683ec23befea56d885bc18e7e0fdc6fdf08b.tar.gz
rsyslog-bec7683ec23befea56d885bc18e7e0fdc6fdf08b.tar.xz
rsyslog-bec7683ec23befea56d885bc18e7e0fdc6fdf08b.zip
enhanced $Include to allow inclusion of a complete directory
Diffstat (limited to 'cfsysline.c')
-rw-r--r--cfsysline.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/cfsysline.c b/cfsysline.c
index af197269..6244c2ee 100644
--- a/cfsysline.c
+++ b/cfsysline.c
@@ -436,7 +436,7 @@ static rsRetVal cslchCallHdlr(cslCmdHdlr_t *pThis, uchar **ppConfLine)
CHKiRet(pHdlr(ppConfLine, pThis->cslCmdHdlr, pThis->pData));
finalize_it:
- return RS_RET_OK;
+ return iRet;
}
@@ -571,6 +571,7 @@ finalize_it:
rsRetVal processCfSysLineCommand(uchar *pCmdName, uchar **p)
{
DEFiRet;
+ rsRetVal iRetLL; /* for linked list handling */
cslCmd_t *pCmd;
cslCmdHdlr_t *pCmdHdlr;
linkedListCookie_t llCookieCmdHdlr;
@@ -578,10 +579,18 @@ rsRetVal processCfSysLineCommand(uchar *pCmdName, uchar **p)
int bWasOnceOK; /* was the result of an handler at least once RS_RET_OK? */
uchar *pOKp = NULL; /* returned conf line pointer when it was OK */
- CHKiRet(llFind(&llCmdList, (void *) pCmdName, (void**) &pCmd));
+ iRet = llFind(&llCmdList, (void *) pCmdName, (void**) &pCmd);
+
+ if(iRet == RS_RET_NOT_FOUND) {
+ logerror("invalid or yet-unknown config file command - have you forgotten to load a module?");
+ }
+
+ if(iRet != RS_RET_OK)
+ goto finalize_it;
+
llCookieCmdHdlr = NULL;
bWasOnceOK = 0;
- while((iRet = llGetNextElt(&pCmd->llCmdHdlrs, &llCookieCmdHdlr, (void**)&pCmdHdlr)) == RS_RET_OK) {
+ while((iRetLL = llGetNextElt(&pCmd->llCmdHdlrs, &llCookieCmdHdlr, (void**)&pCmdHdlr)) == RS_RET_OK) {
/* for the time being, we ignore errors during handlers. The
* reason is that handlers are independent. An error in one
* handler does not necessarily mean that another one will
@@ -590,7 +599,7 @@ rsRetVal processCfSysLineCommand(uchar *pCmdName, uchar **p)
* necessary). -- rgerhards, 2007-07-31
*/
pHdlrP = *p;
- if(cslchCallHdlr(pCmdHdlr, &pHdlrP) == RS_RET_OK) {
+ if((iRet = cslchCallHdlr(pCmdHdlr, &pHdlrP)) == RS_RET_OK) {
bWasOnceOK = 1;
pOKp = pHdlrP;
}
@@ -601,6 +610,9 @@ rsRetVal processCfSysLineCommand(uchar *pCmdName, uchar **p)
iRet = RS_RET_OK;
}
+ if(iRetLL != RS_RET_END_OF_LINKEDLIST)
+ iRet = iRetLL;
+
finalize_it:
return iRet;
}