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. --- builtin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'builtin.c') diff --git a/builtin.c b/builtin.c index 0f2c62f8..e2143b36 100644 --- a/builtin.c +++ b/builtin.c @@ -129,9 +129,9 @@ wrerror: if (errno == 0 || errno == EINVAL) w32_maybe_set_errno(); #endif - /* die silently on EPIPE to stdout */ + /* for stdout, die with a real SIGPIPE, like other awks */ if (fp == stdout && errno == EPIPE) - gawk_exit(EXIT_SUCCESS); // a la SIGPIPE + die_via_sigpipe(); /* otherwise die verbosely */ if ((rp != NULL) ? is_non_fatal_redirect(rp->value, strlen(rp->value)) : is_non_fatal_std(fp)) -- cgit v1.2.3