summaryrefslogtreecommitdiffstats
path: root/tools/omfile.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-03-11 15:26:51 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2009-03-11 15:26:51 +0100
commita03d90abe1d3ac67bc5492db09e2c6e207288469 (patch)
treea96883e852250445eaae2e218874b3074350c6c7 /tools/omfile.c
parent4df8bb4e6b6c8183c504fdb31d667717bf7584e5 (diff)
downloadrsyslog-a03d90abe1d3ac67bc5492db09e2c6e207288469.tar.gz
rsyslog-a03d90abe1d3ac67bc5492db09e2c6e207288469.tar.xz
rsyslog-a03d90abe1d3ac67bc5492db09e2c6e207288469.zip
try to make file writer restartable (experimental, untested)
Diffstat (limited to 'tools/omfile.c')
-rw-r--r--tools/omfile.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/omfile.c b/tools/omfile.c
index 1539ae19..4bef5dbf 100644
--- a/tools/omfile.c
+++ b/tools/omfile.c
@@ -621,20 +621,21 @@ again:
*/
if((pData->fileType == eTypeTTY || pData->fileType == eTypeCONSOLE)
#ifdef linux
- && e == EIO) {
+ && e == EIO
#else
- && e == EBADF) {
+ && e == EBADF
#endif
+ ) {
pData->fd = open((char*) pData->f_fname, O_WRONLY|O_APPEND|O_NOCTTY);
if (pData->fd < 0) {
- iRet = RS_RET_DISABLE_ACTION;
+ iRet = RS_RET_SUSPENDED;
errmsg.LogError(0, NO_ERRCODE, "%s", pData->f_fname);
} else {
untty();
goto again;
}
} else {
- iRet = RS_RET_DISABLE_ACTION;
+ iRet = RS_RET_SUSPENDED;
errno = e;
errmsg.LogError(0, NO_ERRCODE, "%s", pData->f_fname);
}