aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2016-11-04 09:48:28 +0200
committerEli Zaretskii <eliz@gnu.org>2016-11-04 09:48:28 +0200
commit3fa6f02daabc1bf2cc21f7854c4af990627a8863 (patch)
treef6070d5eaf9eb29256bbf62a9ce84ec787d2a078 /builtin.c
parent95aa1b0f60981430eb5cca81ead2d86d3c2793e1 (diff)
downloadegawk-3fa6f02daabc1bf2cc21f7854c4af990627a8863.tar.gz
egawk-3fa6f02daabc1bf2cc21f7854c4af990627a8863.tar.bz2
egawk-3fa6f02daabc1bf2cc21f7854c4af990627a8863.zip
Improve behavior on MS-Windows when stdout is redirected to a pipe.
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin.c b/builtin.c
index 0163b81c..18c01f6e 100644
--- a/builtin.c
+++ b/builtin.c
@@ -125,6 +125,10 @@ efwrite(const void *ptr,
return;
wrerror:
+#ifdef __MINGW32__
+ if (errno == 0 || errno == EINVAL)
+ w32_maybe_set_errno();
+#endif
/* die silently on EPIPE to stdout */
if (fp == stdout && errno == EPIPE)
gawk_exit(EXIT_FATAL);