diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2021-12-01 22:42:07 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2021-12-01 22:42:07 +0200 |
commit | f77e1318c515d495ac9c08bdfdf2dadf79a9649f (patch) | |
tree | 10811b68fc7b1af1909213db7b991d79e580c0a9 /io.c | |
parent | 4285d605b8c0cbe4e0b15724af1b4bd223f25403 (diff) | |
download | egawk-f77e1318c515d495ac9c08bdfdf2dadf79a9649f.tar.gz egawk-f77e1318c515d495ac9c08bdfdf2dadf79a9649f.tar.bz2 egawk-f77e1318c515d495ac9c08bdfdf2dadf79a9649f.zip |
Convert w32_maybe_set_errno to os_maybe_set_errno.
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 18 |
1 files changed, 6 insertions, 12 deletions
@@ -1463,10 +1463,8 @@ 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 + os_maybe_set_errno(); + if (errno == EPIPE) die_via_sigpipe(); else @@ -1563,10 +1561,8 @@ close_io(bool *stdio_problem, bool *got_EPIPE) *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 + os_maybe_set_errno(); + if (errno != EPIPE) warning(_("error writing standard output: %s"), strerror(errno)); else @@ -1576,10 +1572,8 @@ close_io(bool *stdio_problem, bool *got_EPIPE) *stdio_problem = true; } if (fflush(stderr) != 0) { -#ifdef __MINGW32__ - if (errno == 0 || errno == EINVAL) - w32_maybe_set_errno(); -#endif + os_maybe_set_errno(); + if (errno != EPIPE) warning(_("error writing standard error: %s"), strerror(errno)); else |