diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2013-11-01 09:34:56 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2013-11-01 09:34:56 +0200 |
commit | 62c42c359af9b08180d25d3075a1b8ca5d52dee6 (patch) | |
tree | f682e4ec935efe431f8629a089687d0da3d08283 | |
parent | a5504ee040ec62d055996d505b9844d38de274de (diff) | |
download | egawk-62c42c359af9b08180d25d3075a1b8ca5d52dee6.tar.gz egawk-62c42c359af9b08180d25d3075a1b8ca5d52dee6.tar.bz2 egawk-62c42c359af9b08180d25d3075a1b8ca5d52dee6.zip |
Additional work for EPIPE errors on stdout.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | builtin.c | 5 |
2 files changed, 10 insertions, 0 deletions
@@ -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 @@ -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")); |