summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-10-07 11:42:49 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-10-07 11:42:49 +0200
commitcd5253fa82fdbd7529f76c9cec2130e1ccb210bb (patch)
tree1c5d255699d553a6387cb155e1fb08e0f95752db /runtime
parentcf1aaf14fa2bcb457a306d42723ed91a76df00f1 (diff)
downloadrsyslog-cd5253fa82fdbd7529f76c9cec2130e1ccb210bb.tar.gz
rsyslog-cd5253fa82fdbd7529f76c9cec2130e1ccb210bb.tar.xz
rsyslog-cd5253fa82fdbd7529f76c9cec2130e1ccb210bb.zip
bugfix: imfile did invalid system call under some circumstances
when a file that was to be monitored did not exist BUT the state file actually existed. Mostly a cosmetic issue. Root cause was incomplete error checking in stream.c; so patch may affect other code areas.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/stream.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/runtime/stream.c b/runtime/stream.c
index ae716815..0238d25e 100644
--- a/runtime/stream.c
+++ b/runtime/stream.c
@@ -1276,16 +1276,18 @@ static rsRetVal strmSeek(strm_t *pThis, off64_t offs)
ISOBJ_TYPE_assert(pThis, strm);
- if(pThis->fd == -1)
- strmOpenFile(pThis);
- else
- strmFlushInternal(pThis);
+ if(pThis->fd == -1) {
+ CHKiRet(strmOpenFile(pThis));
+ } else {
+ CHKiRet(strmFlushInternal(pThis));
+ }
long long i;
DBGOPRINT((obj_t*) pThis, "file %d seek, pos %llu\n", pThis->fd, (long long unsigned) offs);
i = lseek64(pThis->fd, offs, SEEK_SET); // TODO: check error!
pThis->iCurrOffs = offs; /* we are now at *this* offset */
pThis->iBufPtr = 0; /* buffer invalidated */
+finalize_it:
RETiRet;
}