summaryrefslogtreecommitdiffstats
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)
commit4b98569f897cfeb52b74ea8c8957cc84244d4944 (patch)
tree2ecd338fc554f7163a1764d9dbb8d72ed9997065
parent0fe50b37a2a0e487e648136d0f3e77cd4428f1e0 (diff)
downloadtcl-4b98569f897cfeb52b74ea8c8957cc84244d4944.zip
tcl-4b98569f897cfeb52b74ea8c8957cc84244d4944.tar.gz
tcl-4b98569f897cfeb52b74ea8c8957cc84244d4944.tar.bz2
Update comment to explain assumptions.
-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;
}