diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2010-10-15 08:23:29 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2010-10-15 08:23:29 +0200 |
commit | ed9fd3541f07929008a64f5b6ea3bcce70e62c25 (patch) | |
tree | e82a339428b39355a3e13a29f139987c07bd19c3 | |
parent | 8c3d40b798e3ed68fb03629d87b55140cb6bc044 (diff) | |
download | rsyslog-ed9fd3541f07929008a64f5b6ea3bcce70e62c25.tar.gz rsyslog-ed9fd3541f07929008a64f5b6ea3bcce70e62c25.tar.xz rsyslog-ed9fd3541f07929008a64f5b6ea3bcce70e62c25.zip |
imfile: bug fixes
either one or two bugs fixed ;)
Definitely a problem where no state file is written when working with
relative pathes. Also, some problems with offsets should be fixed for
very large files. However, I could not yet experimentally show the issue
so it probably needs more verification.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | plugins/imfile/imfile.c | 5 | ||||
-rw-r--r-- | runtime/stream.c | 6 |
3 files changed, 11 insertions, 4 deletions
@@ -1,4 +1,8 @@ --------------------------------------------------------------------------- +Version 5.7.2 [V5-DEVEL] (rgerhards), 2010-10-05 +- bugfix: imfile state file was not written when relative file name + for it was specified +--------------------------------------------------------------------------- Version 5.7.1 [V5-DEVEL] (rgerhards), 2010-10-05 - support for Hadoop's HDFS added (via omhdfs) - imuxsock now optionally use SCM_CREDENTIALS to pull the pid from the log diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c index 8a10e26f..e067014e 100644 --- a/plugins/imfile/imfile.c +++ b/plugins/imfile/imfile.c @@ -337,12 +337,15 @@ persistStrmState(fileInfo_t *pInfo) { DEFiRet; strm_t *psSF = NULL; /* state file (stream) */ + size_t lenDir; ASSERT(pInfo != NULL); /* TODO: create a function persistObj in obj.c? */ CHKiRet(strm.Construct(&psSF)); - CHKiRet(strm.SetDir(psSF, glbl.GetWorkDir(), strlen((char*)glbl.GetWorkDir()))); + lenDir = ustrlen(glbl.GetWorkDir()); + if(lenDir > 0) + CHKiRet(strm.SetDir(psSF, glbl.GetWorkDir(), lenDir)); CHKiRet(strm.SettOperationsMode(psSF, STREAMMODE_WRITE_TRUNC)); CHKiRet(strm.SetsType(psSF, STREAMTYPE_FILE_SINGLE)); CHKiRet(strm.SetFName(psSF, pInfo->pszStateFile, strlen((char*) pInfo->pszStateFile))); diff --git a/runtime/stream.c b/runtime/stream.c index b4295762..7f965029 100644 --- a/runtime/stream.c +++ b/runtime/stream.c @@ -1473,7 +1473,7 @@ static rsRetVal strmSerialize(strm_t *pThis, strm_t *pStrm) { DEFiRet; int i; - long l; + int64 ll; ISOBJ_TYPE_assert(pThis, strm); ISOBJ_TYPE_assert(pStrm, strm); @@ -1495,8 +1495,8 @@ static rsRetVal strmSerialize(strm_t *pThis, strm_t *pStrm) i = pThis->tOpenMode; objSerializeSCALAR_VAR(pStrm, tOpenMode, INT, i); - l = (long) pThis->iCurrOffs; - objSerializeSCALAR_VAR(pStrm, iCurrOffs, LONG, l); + ll = pThis->iCurrOffs; + objSerializeSCALAR_VAR(pStrm, iCurrOffs, INT64, ll); CHKiRet(obj.EndSerialize(pStrm)); |