summaryrefslogtreecommitdiffstats
path: root/runtime/ruleset.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-01-08 13:07:47 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-01-08 13:07:47 +0100
commit84f959d4f0dfb6a9e1dda43e17a97402b55d3314 (patch)
tree3d0d49eebd701cbc1690501688794f7eddbc7696 /runtime/ruleset.c
parent7febb07e2a587c0646c155796ed1fa91f89682fb (diff)
parentbbb2066d17824f366d0f83a010cae6ebe99d4fa0 (diff)
downloadrsyslog-84f959d4f0dfb6a9e1dda43e17a97402b55d3314.tar.gz
rsyslog-84f959d4f0dfb6a9e1dda43e17a97402b55d3314.tar.bz2
rsyslog-84f959d4f0dfb6a9e1dda43e17a97402b55d3314.zip
Merge branch 'v7-stable'
Diffstat (limited to 'runtime/ruleset.c')
-rw-r--r--runtime/ruleset.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/runtime/ruleset.c b/runtime/ruleset.c
index c8cb87fd..21c3c337 100644
--- a/runtime/ruleset.c
+++ b/runtime/ruleset.c
@@ -299,7 +299,9 @@ execIf(struct cnfstmt *stmt, batch_t *pBatch, sbool *active)
sbool bRet;
DEFiRet;
newAct = newActive(pBatch);
- for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) {
+ for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) {
+ if(*(pBatch->pbShutdownImmediate))
+ FINALIZE;
if(pBatch->pElem[i].state == BATCH_STATE_DISC)
continue; /* will be ignored in any case */
if(active == NULL || active[i]) {
@@ -314,13 +316,16 @@ execIf(struct cnfstmt *stmt, batch_t *pBatch, sbool *active)
scriptExec(stmt->d.s_if.t_then, pBatch, newAct);
}
if(stmt->d.s_if.t_else != NULL) {
- for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate)
- ; ++i)
+ for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) {
+ if(*(pBatch->pbShutdownImmediate))
+ FINALIZE;
if(pBatch->pElem[i].state != BATCH_STATE_DISC)
newAct[i] = !newAct[i];
+ }
scriptExec(stmt->d.s_if.t_else, pBatch, newAct);
}
freeActive(newAct);
+finalize_it:
RETiRet;
}
@@ -333,7 +338,9 @@ execPRIFILT(struct cnfstmt *stmt, batch_t *pBatch, sbool *active)
int bRet;
int i;
newAct = newActive(pBatch);
- for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) {
+ for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) {
+ if(*(pBatch->pbShutdownImmediate))
+ return;
if(pBatch->pElem[i].state == BATCH_STATE_DISC)
continue; /* will be ignored in any case */
pMsg = pBatch->pElem[i].pMsg;
@@ -354,10 +361,12 @@ execPRIFILT(struct cnfstmt *stmt, batch_t *pBatch, sbool *active)
scriptExec(stmt->d.s_prifilt.t_then, pBatch, newAct);
}
if(stmt->d.s_prifilt.t_else != NULL) {
- for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate)
- ; ++i)
+ for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) {
+ if(*(pBatch->pbShutdownImmediate))
+ return;
if(pBatch->pElem[i].state != BATCH_STATE_DISC)
newAct[i] = !newAct[i];
+ }
scriptExec(stmt->d.s_prifilt.t_else, pBatch, newAct);
}
freeActive(newAct);
@@ -461,7 +470,9 @@ execPROPFILT(struct cnfstmt *stmt, batch_t *pBatch, sbool *active)
sbool bRet;
int i;
thenAct = newActive(pBatch);
- for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) {
+ for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) {
+ if(*(pBatch->pbShutdownImmediate))
+ return;
if(pBatch->pElem[i].state == BATCH_STATE_DISC)
continue; /* will be ignored in any case */
if(active == NULL || active[i]) {