From 1b5d1b8870cb0ac1c4b99f6cf67e3277427df864 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 4 Apr 2016 23:11:19 +0300 Subject: Add warning for fflush of closed write end on 2-way pipe. --- io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'io.c') diff --git a/io.c b/io.c index de753973..fe1261aa 100644 --- a/io.c +++ b/io.c @@ -1328,7 +1328,7 @@ flush_io() warning(_("error writing standard error (%s)"), strerror(errno)); status++; } - for (rp = red_head; rp != NULL; rp = rp->next) + for (rp = red_head; rp != NULL; rp = rp->next) { /* flush both files and pipes, what the heck */ if ((rp->flag & RED_WRITE) != 0 && rp->output.fp != NULL) { if (rp->output.gawk_fflush(rp->output.fp, rp->output.opaque)) { @@ -1344,6 +1344,7 @@ flush_io() status++; } } + } if (status != 0) status = -1; /* canonicalize it */ return status; -- cgit v1.2.3