aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--builtin.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 3798a5f9..df252b1e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-10-31 Arnold D. Robbins <arnold@skeeve.com>
+
+ * builtin.c (efwrite): If write error to stdout is EPIPE,
+ die silently. Thanks to Hermann Peifer for helping find this.
+
2013-10-22 Arnold D. Robbins <arnold@skeeve.com>
Revise error messages when writing to standard output or standard
diff --git a/builtin.c b/builtin.c
index 9258ea60..bb7050b0 100644
--- a/builtin.c
+++ b/builtin.c
@@ -125,6 +125,11 @@ efwrite(const void *ptr,
return;
wrerror:
+ /* die silently on EPIPE to stdout */
+ if (fp == stdout && errno == EPIPE)
+ gawk_exit(EXIT_FATAL);
+
+ /* otherwise die verbosely */
fatal(_("%s to \"%s\" failed (%s)"), from,
rp ? rp->value : _("standard output"),
errno ? strerror(errno) : _("reason unknown"));