summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-06-08 18:39:06 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-06-08 18:39:06 +0200
commit8d1e2e496c6a4a4d40d1e8604c746e0d32013536 (patch)
treef98dfe6ae70878b49135de308703f9096c0b394b /tools
parent84b786753744d9f7a002665571a428283feae248 (diff)
downloadrsyslog-8d1e2e496c6a4a4d40d1e8604c746e0d32013536.tar.gz
rsyslog-8d1e2e496c6a4a4d40d1e8604c746e0d32013536.tar.xz
rsyslog-8d1e2e496c6a4a4d40d1e8604c746e0d32013536.zip
improved error handling and added fsync() support
... restoring missing functionality after the restructuring of imfile. As a side-effect, this also lays the foundation for even more reliable queue engine operations (but this is not yet done).
Diffstat (limited to 'tools')
-rw-r--r--tools/omfile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/omfile.c b/tools/omfile.c
index f196d602..e3f7af19 100644
--- a/tools/omfile.c
+++ b/tools/omfile.c
@@ -116,7 +116,7 @@ typedef struct _instanceData {
eTypePIPE
} fileType;
char bDynamicName; /* 0 - static name, 1 - dynamic name (with properties) */
- int fCreateMode; /* file creation mode for open() */ // TODO: shuffle down to stream class
+ int fCreateMode; /* file creation mode for open() */
int fDirCreateMode; /* creation mode for mkdir() */
int bCreateDirs; /* auto-create directories? */
int bSyncFile; /* should the file by sync()'ed? 1- yes, 0- no */ // TODO: stream class? RE-IMPLEMENT!
@@ -472,6 +472,8 @@ prepareFile(instanceData *pData, uchar *newFileName)
CHKiRet(strm.SetiZipLevel(pData->pStrm, pData->iZipLevel));
CHKiRet(strm.SetsIOBufSize(pData->pStrm, (size_t) pData->iIOBufSize));
CHKiRet(strm.SettOperationsMode(pData->pStrm, STREAMMODE_WRITE_APPEND));
+ CHKiRet(strm.SettOpenMode(pData->pStrm, fCreateMode));
+ CHKiRet(strm.SetbSync(pData->pStrm, pData->bSyncFile));
CHKiRet(strm.SetsType(pData->pStrm, STREAMTYPE_FILE_SINGLE));
CHKiRet(strm.ConstructFinalize(pData->pStrm));