summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-05-28 18:49:02 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-05-28 18:49:02 (GMT)
commit8dc54fa3e0120b8916399d8eb7c07c8dbf3810cb (patch)
tree2ecd338fc554f7163a1764d9dbb8d72ed9997065 /generic
parenta6b4426c1c32f4aefd4a2dc2d6aa60a756d1a586 (diff)
downloadtcl-8dc54fa3e0120b8916399d8eb7c07c8dbf3810cb.zip
tcl-8dc54fa3e0120b8916399d8eb7c07c8dbf3810cb.tar.gz
tcl-8dc54fa3e0120b8916399d8eb7c07c8dbf3810cb.tar.bz2
Update comment to explain assumptions.dgp_flush_channel
Diffstat (limited to 'generic')
-rw-r--r--generic/tclIO.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 911fa97..ccd5708 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -3655,9 +3655,16 @@ static int WillRead(Channel *chanPtr)
if ((chanPtr->typePtr->seekProc != NULL)
&& (Tcl_OutputBuffered((Tcl_Channel) chanPtr) > 0)) {
- /* TODO: Consider when channel is nonblocking and this
- * FlushChannel() call may not finish the task of shoving
- * bytes out. Then what? */
+ /*
+ * CAVEAT - The assumption here is that FlushChannel() will
+ * push out the bytes of any writes that are in progress.
+ * Since this is a seekable channel, we assume it is not one
+ * that can block and force bg flushing. Channels we know that
+ * can do that -- sockets, pipes -- are not seekable. If the
+ * assumption is wrong, more drastic measures may be required here
+ * like temporarily setting the channel into blocking mode.
+ */
+
if (FlushChannel(NULL, chanPtr, 0) != 0) {
return -1;
}