Blame SOURCES/rsyslog-8.24.0-rhbz1399569-flushontxend.patch

a856a8
From 1a80a71e91f445f29763fbd724a1c6f3fbf2077a Mon Sep 17 00:00:00 2001
a856a8
From: Tomas Sykora <tosykora@redhat.com>
a856a8
Date: Fri, 23 Dec 2016 06:49:22 -0500
a856a8
Subject: [PATCH 1/3] When flushOnTXEnd is off messages should be written to a
a856a8
 file only when the buffer is full. This was broken with upstream commit
a856a8
 6de0103, which was reverted with this patch.
a856a8
a856a8
Resolves: RHBZ#1399569
a856a8
---
a856a8
 tools/omfile.c | 9 ++-------
a856a8
 1 file changed, 2 insertions(+), 7 deletions(-)
a856a8
a856a8
diff --git a/tools/omfile.c b/tools/omfile.c
a856a8
index 77bf65c..4d849c5 100644
a856a8
--- a/tools/omfile.c
a856a8
+++ b/tools/omfile.c
a856a8
@@ -1046,14 +1046,9 @@ CODESTARTcommitTransaction
a856a8
 		writeFile(pData, pParams, i);
a856a8
 	}
a856a8
 	/* Note: pStrm may be NULL if there was an error opening the stream */
a856a8
-	if(pData->bUseAsyncWriter) {
a856a8
-		if(pData->bFlushOnTXEnd && pData->pStrm != NULL) {
a856a8
+	if(pData->bFlushOnTXEnd && pData->pStrm != NULL) {
a856a8
+		if(!pData->bUseAsyncWriter)
a856a8
 			CHKiRet(strm.Flush(pData->pStrm));
a856a8
-		}
a856a8
-	} else {
a856a8
-		if(pData->pStrm != NULL) {
a856a8
-			CHKiRet(strm.Flush(pData->pStrm));
a856a8
-		}
a856a8
 	}
a856a8
 
a856a8
 finalize_it:
a856a8
-- 
a856a8
2.9.3
a856a8