5523e9
From f515907c71c03019a52f89921c41303fa5926b2a Mon Sep 17 00:00:00 2001
5523e9
From: Lubos Kardos <lkardos@redhat.com>
5523e9
Date: Fri, 12 Jun 2015 13:38:23 +0200
5523e9
Subject: [PATCH] Don't show error message if log function fails because of
5523e9
 broken pipe.
5523e9
5523e9
- regression from commit 11b005c957fb0e52d42078480104d3e27e95e609
5523e9
- rhbz: #1231138
5523e9
---
5523e9
 rpmio/rpmlog.c | 7 ++++---
5523e9
 1 file changed, 4 insertions(+), 3 deletions(-)
5523e9
5523e9
diff --git a/rpmio/rpmlog.c b/rpmio/rpmlog.c
5523e9
index f43e622..43ae36f 100644
5523e9
--- a/rpmio/rpmlog.c
5523e9
+++ b/rpmio/rpmlog.c
5523e9
@@ -4,7 +4,8 @@
5523e9
 
5523e9
 #include "system.h"
5523e9
 #include <stdarg.h>
5523e9
+#include <errno.h>
5523e9
 #include <stdlib.h>
5523e9
 #include <rpm/rpmlog.h>
5523e9
 #include "debug.h"
5523e9
 
5523e9
@@ -127,13 +128,13 @@ static int rpmlogDefault(FILE *stdlog, rpmlogRec rec)
5523e9
         break;
5523e9
     }
5523e9
 
5523e9
-    if (fputs(rpmlogLevelPrefix(rec->pri), msgout) == EOF)
5523e9
+    if (fputs(rpmlogLevelPrefix(rec->pri), msgout) == EOF && errno != EPIPE)
5523e9
 	perror("Error occurred during writing of a log message");
5523e9
 
5523e9
-    if (fputs(rec->message, msgout) == EOF)
5523e9
+    if (fputs(rec->message, msgout) == EOF && errno != EPIPE)
5523e9
 	perror("Error occurred during writing of a log message");
5523e9
 
5523e9
-    if (fflush(msgout) == EOF)
5523e9
+    if (fflush(msgout) == EOF && errno != EPIPE)
5523e9
 	perror("Error occurred during writing of a log message");
5523e9
 
5523e9
     return (rec->pri <= RPMLOG_CRIT ? RPMLOG_EXIT : 0);
5523e9
-- 
5523e9
1.9.3
5523e9