aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2017-04-11 22:26:25 +0300
committerArnold D. Robbins <arnold@skeeve.com>2017-04-11 22:26:25 +0300
commitbb83ae45d4c9989b21e599e3cdab90a17541d2b2 (patch)
tree1c853fceb2803d6bf2c6bb4eb53ebd6f1057bd63 /io.c
parent49ccc0da1e2cee9064ba9957c265994b1741b15d (diff)
parentbd6dc293e35fdeac05bd1577593e111fd09d22b7 (diff)
downloadegawk-bb83ae45d4c9989b21e599e3cdab90a17541d2b2.tar.gz
egawk-bb83ae45d4c9989b21e599e3cdab90a17541d2b2.tar.bz2
egawk-bb83ae45d4c9989b21e599e3cdab90a17541d2b2.zip
Merge branch 'master' into feature/fix-comments
Diffstat (limited to 'io.c')
-rw-r--r--io.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/io.c b/io.c
index b00f4db4..f854ec5a 100644
--- a/io.c
+++ b/io.c
@@ -1399,6 +1399,10 @@ non_fatal_flush_std_file(FILE *fp)
bool is_fatal = ! is_non_fatal_std(fp);
if (is_fatal) {
+#ifdef __MINGW32__
+ if (errno == 0 || errno == EINVAL)
+ w32_maybe_set_errno();
+#endif
if (errno == EPIPE)
die_via_sigpipe();
else
@@ -1494,12 +1498,20 @@ close_io(bool *stdio_problem)
*stdio_problem = false;
/* we don't warn about stdout/stderr if EPIPE, but we do error exit */
if (fflush(stdout) != 0) {
+#ifdef __MINGW32__
+ if (errno == 0 || errno == EINVAL)
+ w32_maybe_set_errno();
+#endif
if (errno != EPIPE)
warning(_("error writing standard output (%s)"), strerror(errno));
status++;
*stdio_problem = true;
}
if (fflush(stderr) != 0) {
+#ifdef __MINGW32__
+ if (errno == 0 || errno == EINVAL)
+ w32_maybe_set_errno();
+#endif
if (errno != EPIPE)
warning(_("error writing standard error (%s)"), strerror(errno));
status++;