aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-04-07 21:59:34 +0300
committerArnold D. Robbins <arnold@skeeve.com>2016-04-07 21:59:34 +0300
commitb6fac528542ff95fa89e40a6a4c1da2a7346279b (patch)
tree74932f73f322a7719675f33e3699f61abde16e8c /builtin.c
parent43a645fe05c57576d9d41a7f3b18bb55b1dbdc3e (diff)
parentea1c544208913c0871fb21d9a5d6277d83bf2ef2 (diff)
downloadegawk-b6fac528542ff95fa89e40a6a4c1da2a7346279b.tar.gz
egawk-b6fac528542ff95fa89e40a6a4c1da2a7346279b.tar.bz2
egawk-b6fac528542ff95fa89e40a6a4c1da2a7346279b.zip
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/builtin.c b/builtin.c
index e07bdb53..4256ee5e 100644
--- a/builtin.c
+++ b/builtin.c
@@ -1683,6 +1683,7 @@ do_printf(int nargs, int redirtype)
update_ERRNO_int(EBADF);
return;
}
+ (void) close_rp(rp, CLOSE_ALL);
fatal(_("printf: attempt to write to closed write end of two-way pipe"));
}
fp = rp->output.fp;
@@ -2119,7 +2120,11 @@ do_system(int nargs)
if (do_posix)
; /* leave it alone, full 16 bits */
else if (do_traditional)
+#ifdef __MINGW32__
+ ret = (((unsigned)status) & ~0xC0000000);
+#else
ret = (status / 256.0);
+#endif
else if (WIFEXITED(status))
ret = WEXITSTATUS(status); /* normal exit */
else if (WIFSIGNALED(status)) {
@@ -2167,6 +2172,7 @@ do_print(int nargs, int redirtype)
update_ERRNO_int(EBADF);
return;
}
+ (void) close_rp(rp, CLOSE_ALL);
fatal(_("print: attempt to write to closed write end of two-way pipe"));
}
fp = rp->output.fp;
@@ -2245,6 +2251,7 @@ do_print_rec(int nargs, int redirtype)
update_ERRNO_int(EBADF);
return;
}
+ (void) close_rp(rp, CLOSE_ALL);
fatal(_("print: attempt to write to closed write end of two-way pipe"));
}
fp = rp->output.fp;