summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
diff options
context:
space:
mode:
authordgp@users.sourceforge.net <dgp>2014-05-31 02:30:53 (GMT)
committerdgp@users.sourceforge.net <dgp>2014-05-31 02:30:53 (GMT)
commit6446eb1c2391e95d9e279c13a05f8289812ad47c (patch)
tree3f9b6d9193106dd231d49d362e80218a14e32d8b /generic/tclIO.c
parent08237c16c4c74af512b8a37e3e94d1dc76797140 (diff)
downloadtcl-6446eb1c2391e95d9e279c13a05f8289812ad47c.zip
tcl-6446eb1c2391e95d9e279c13a05f8289812ad47c.tar.gz
tcl-6446eb1c2391e95d9e279c13a05f8289812ad47c.tar.bz2
Correct the interest masks in the Tcl_CreateFileHandler() calls in
PipeWatchProc(). When we are interested in both readable and writable events of a command pipeline channel, we only want the readable from the read end of the pipe, and the writable from the write end of the pipe.
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r--generic/tclIO.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 0716074..1c4a5b3 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -2694,11 +2694,18 @@ FlushChannel(
(chanPtr->typePtr->watchProc)(chanPtr->instanceData,
statePtr->interestMask);
} else {
- /* TODO: If code reaches this point, it means a writable
- * event is being handled on the channel, but the channel
- * could not in fact be written to. This ought not happen,
- * but Unix pipes appear to act this way (see io-53.4).
- * Also can imagine broken reflected channels. */
+
+ /*
+ * When we are calledFromAsyncFlush, that means a writable
+ * state on the channel triggered the call, so we should be
+ * able to write something. Either we did write something
+ * and wroteSome should be set, or there was nothing left to
+ * write in this call, and we've completed the BG flush.
+ * These are the two cases above. If we get here, that means
+ * there is some kind failure in the writable event machinery.
+ */
+
+ assert(!calledFromAsyncFlush);
}
}