summaryrefslogtreecommitdiffstats
path: root/stream.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-27 10:49:43 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-27 10:49:43 +0000
commiteb006d74dd8bbadbd7a551e732e373e7cf3ad9c9 (patch)
treed796696a0edac5701ca9726ee5f564fc4e405410 /stream.c
parent327467c6f685d25621bb33bc3ab746800ba008d2 (diff)
downloadrsyslog-eb006d74dd8bbadbd7a551e732e373e7cf3ad9c9.tar.gz
rsyslog-eb006d74dd8bbadbd7a551e732e373e7cf3ad9c9.tar.xz
rsyslog-eb006d74dd8bbadbd7a551e732e373e7cf3ad9c9.zip
bugfix: queue disk file were not properly persisted when immediately after
closing an output file rsyslog was stopped or huped (the new output file open must NOT have happend at that point) - this lead to a sparse and invalid queue file which could cause several problems to the engine (unpredictable results). This situation should have happened only in very rare cases. tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=40
Diffstat (limited to 'stream.c')
-rw-r--r--stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stream.c b/stream.c
index b6be4da2..0f05c97c 100644
--- a/stream.c
+++ b/stream.c
@@ -137,6 +137,7 @@ static rsRetVal strmCloseFile(strm_t *pThis)
unlink((char*) pThis->pszCurrFName); // TODO: check returncode
}
+ pThis->iCurrOffs = 0; /* we are back at begin of file */
if(pThis->pszCurrFName != NULL) {
free(pThis->pszCurrFName); /* no longer needed in any case (just for open) */
pThis->pszCurrFName = NULL;
@@ -199,7 +200,6 @@ strmHandleEOFMonitor(strm_t *pThis)
ABORT_FINALIZE(RS_RET_IO_ERROR);
if(stat((char*) pThis->pszCurrFName, &statName) == -1)
ABORT_FINALIZE(RS_RET_IO_ERROR);
-//dbgoprint((obj_t*)pThis, "curr ino %d, new ino %d, curr offset %lld, new size %ld\n", statOpen.st_ino, statName.st_ino, pThis->iCurrOffs, statName.st_size);
if(statOpen.st_ino == statName.st_ino && pThis->iCurrOffs == statName.st_size) {
ABORT_FINALIZE(RS_RET_EOF);
} else {