From 5b7042ea0a68d41c4fbd0d6228f77975ebf8c38b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 27 Mar 2017 20:30:14 +0300 Subject: Die with SIGPIPE when EPIPE happens on stdout. --- main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 4f578d3e..73e63448 100644 --- a/main.c +++ b/main.c @@ -633,7 +633,10 @@ By default it reads standard input and writes standard output.\n\n"), fp); warning(_("error writing standard output (%s)"), strerror(errno)); else if (fp == stderr) warning(_("error writing standard error (%s)"), strerror(errno)); - } + } else if (errno == SIGPIPE) + die_via_sigpipe(); + + // some other problem than SIGPIPE exit(EXIT_FAILURE); } -- cgit v1.2.3