aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-04-04 23:11:19 +0300
committerArnold D. Robbins <arnold@skeeve.com>2016-04-04 23:11:19 +0300
commit1b5d1b8870cb0ac1c4b99f6cf67e3277427df864 (patch)
tree910c37dfb0821cc23de5402c44e4603d2e734721 /builtin.c
parentfae30f292fc0e2e67de188f8129d043f9909bd0b (diff)
downloadegawk-1b5d1b8870cb0ac1c4b99f6cf67e3277427df864.tar.gz
egawk-1b5d1b8870cb0ac1c4b99f6cf67e3277427df864.tar.bz2
egawk-1b5d1b8870cb0ac1c4b99f6cf67e3277427df864.zip
Add warning for fflush of closed write end on 2-way pipe.
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin.c b/builtin.c
index c4d3d3a1..a1c09d5a 100644
--- a/builtin.c
+++ b/builtin.c
@@ -237,6 +237,9 @@ do_fflush(int nargs)
fp = rp->output.fp;
if (fp != NULL)
status = rp->output.gawk_fflush(fp, rp->output.opaque);
+ else if ((rp->flag & RED_TWOWAY) != 0)
+ warning(_("fflush: cannot flush: two-way pipe `%s' has closed write end"),
+ file);
} else if ((fp = stdfile(tmp->stptr, tmp->stlen)) != NULL) {
status = fflush(fp);
} else {