summaryrefslogtreecommitdiffstats
path: root/plugins/imfile/imfile.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-04-17 11:10:51 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2013-04-17 11:10:51 +0200
commit3d914eb90cd7aed1342a01c5993f8c2de4cd1283 (patch)
tree46046d3136b5ca4fd864813b36b62d330a9c9559 /plugins/imfile/imfile.c
parent39b35a32b4a45ccb6506e15b02780c30ca8c3973 (diff)
parent9d59080b4a43ca6d19bece357cb1132374a2116a (diff)
downloadrsyslog-3d914eb90cd7aed1342a01c5993f8c2de4cd1283.tar.gz
rsyslog-3d914eb90cd7aed1342a01c5993f8c2de4cd1283.tar.bz2
rsyslog-3d914eb90cd7aed1342a01c5993f8c2de4cd1283.zip
Merge branch 'master' into master-imjournal
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;
}