diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2017-04-11 22:25:58 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2017-04-11 22:25:58 +0300 |
commit | 1a3454c8dc0c0412810e2ba91816ee83f7e39541 (patch) | |
tree | 8b7ddb44a94cccd8ca0390d35a34b57844630649 /io.c | |
parent | 627836fc67d52e54f004dc4f7ad7ec0f609840f6 (diff) | |
parent | bd6dc293e35fdeac05bd1577593e111fd09d22b7 (diff) | |
download | egawk-1a3454c8dc0c0412810e2ba91816ee83f7e39541.tar.gz egawk-1a3454c8dc0c0412810e2ba91816ee83f7e39541.tar.bz2 egawk-1a3454c8dc0c0412810e2ba91816ee83f7e39541.zip |
Merge branch 'master' into feature/api-parser
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -1400,6 +1400,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 @@ -1495,12 +1499,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++; |