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