aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2017-04-11 22:27:36 +0300
committerArnold D. Robbins <arnold@skeeve.com>2017-04-11 22:27:36 +0300
commit7151f1a0e366345adf052b9b2fb1dbf6dcb04837 (patch)
tree56ddcaa1ebdd4869a28fbb84d6aa07674ed88a6c /main.c
parent887477763ab87b33c06df693e93500991d7c324d (diff)
parentbd6dc293e35fdeac05bd1577593e111fd09d22b7 (diff)
downloadegawk-7151f1a0e366345adf052b9b2fb1dbf6dcb04837.tar.gz
egawk-7151f1a0e366345adf052b9b2fb1dbf6dcb04837.tar.bz2
egawk-7151f1a0e366345adf052b9b2fb1dbf6dcb04837.zip
Merge branch 'master' into feature/memleak
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/main.c b/main.c
index 530d37fd..b6841d57 100644
--- a/main.c
+++ b/main.c
@@ -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));