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

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