summaryrefslogtreecommitdiffstats
path: root/tools/omfile.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-09-26 11:36:44 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-09-26 11:36:44 +0200
commitb26387e6b28630b8e5e3582039141ebf1c7455e3 (patch)
tree2f1128044dec9daac88d8cf3b41db1e1e7decebc /tools/omfile.c
parent6d3cc9e406d3316300eaf537a1aa562e95499d70 (diff)
downloadrsyslog-b26387e6b28630b8e5e3582039141ebf1c7455e3.tar.gz
rsyslog-b26387e6b28630b8e5e3582039141ebf1c7455e3.tar.xz
rsyslog-b26387e6b28630b8e5e3582039141ebf1c7455e3.zip
bugfix: omfile returns fatal error code for things that go really wrong
previously, RS_RET_RESUME was returned, which lead to a loop inside the rule engine as omfile could not really recover.
Diffstat (limited to 'tools/omfile.c')
-rw-r--r--tools/omfile.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/omfile.c b/tools/omfile.c
index 6a2d5e24..55801d40 100644
--- a/tools/omfile.c
+++ b/tools/omfile.c
@@ -663,8 +663,6 @@ finalize_it:
/* in v5, we shall return different states for message-caused failure (but only there!) */
if(pData->strmType == STREAMTYPE_NAMED_PIPE)
iRet = RS_RET_DISABLE_ACTION; /* this is the traditional semantic -- rgerhards, 2010-01-15 */
- else
- iRet = RS_RET_SUSPENDED;
}
RETiRet;
}
@@ -697,7 +695,8 @@ ENDbeginTransaction
BEGINendTransaction
CODESTARTendTransaction
- if(pData->bFlushOnTXEnd) {
+ /* Note: pStrm may be NULL if there was an error opening the stream */
+ if(pData->bFlushOnTXEnd && pData->pStrm != NULL) {
CHKiRet(strm.Flush(pData->pStrm));
}
finalize_it: