summaryrefslogtreecommitdiffstats
path: root/plugins/imfile/imfile.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-03-22 09:33:33 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-03-22 09:33:33 +0100
commit223439934c20f38bc00ec5287124737932d33ddb (patch)
tree83f1b2b82271574ddd503ab1c43049b86817f839 /plugins/imfile/imfile.c
parent785e0c3c8b00614b6f780f902442025f4558a160 (diff)
parent906ed9df906fe3a52b042929130e6fc9a00b53a8 (diff)
downloadrsyslog-223439934c20f38bc00ec5287124737932d33ddb.tar.gz
rsyslog-223439934c20f38bc00ec5287124737932d33ddb.tar.bz2
rsyslog-223439934c20f38bc00ec5287124737932d33ddb.zip
Merge branch 'master' into master-gt
Conflicts: configure.ac runtime/rsyslog.h
Diffstat (limited to 'plugins/imfile/imfile.c')
-rw-r--r--plugins/imfile/imfile.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c
index 0f155c10..349acead 100644
--- a/plugins/imfile/imfile.c
+++ b/plugins/imfile/imfile.c
@@ -235,6 +235,7 @@ openFile(fileInfo_t *pThis)
/* read back in the object */
CHKiRet(obj.Deserialize(&pThis->pStrm, (uchar*) "strm", psSF, NULL, pThis));
+ strm.CheckFileChange(pThis->pStrm);
CHKiRet(strm.SeekCurrOffs(pThis->pStrm));
/* note: we do not delete the state file, so that the last position remains
@@ -738,12 +739,20 @@ persistStrmState(fileInfo_t *pInfo)
CHKiRet(strm.ConstructFinalize(psSF));
CHKiRet(strm.Serialize(pInfo->pStrm, psSF));
+ CHKiRet(strm.Flush(psSF));
CHKiRet(strm.Destruct(&psSF));
finalize_it:
if(psSF != NULL)
strm.Destruct(&psSF);
+
+ if(iRet != RS_RET_OK) {
+ errmsg.LogError(0, iRet, "imfile: could not persist state "
+ "file %s - data may be repeated on next "
+ "startup. Is WorkDirectory set?",
+ pInfo->pszStateFile);
+ }
RETiRet;
}