diff options
author | Eli Zaretskii <eliz@gnu.org> | 2017-04-08 14:37:13 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2017-04-08 14:37:13 +0300 |
commit | bd6dc293e35fdeac05bd1577593e111fd09d22b7 (patch) | |
tree | 1a93402b4c86e03d69c431b5af315c3fcc6aaa5a /main.c | |
parent | 947dfae8571472b6e78aecad8da024f1f65e5bf5 (diff) | |
download | egawk-bd6dc293e35fdeac05bd1577593e111fd09d22b7.tar.gz egawk-bd6dc293e35fdeac05bd1577593e111fd09d22b7.tar.bz2 egawk-bd6dc293e35fdeac05bd1577593e111fd09d22b7.zip |
Fix EPIPE handling in the MinGW build.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -627,6 +627,10 @@ By default it reads standard input and writes standard output.\n\n"), fp); fflush(fp); if (ferror(fp)) { +#ifdef __MINGW32__ + if (errno == 0 || errno == EINVAL) + w32_maybe_set_errno(); +#endif /* don't warn about stdout/stderr if EPIPE, but do error exit */ if (errno == EPIPE) die_via_sigpipe(); @@ -673,6 +677,10 @@ along with this program. If not, see http://www.gnu.org/licenses/.\n"); fflush(stdout); if (ferror(stdout)) { +#ifdef __MINGW32__ + if (errno == 0 || errno == EINVAL) + w32_maybe_set_errno(); +#endif /* don't warn about stdout if EPIPE, but do error exit */ if (errno != EPIPE) warning(_("error writing standard output (%s)"), strerror(errno)); |