summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-10-10 19:44:54 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-10-10 19:44:54 (GMT)
commit4a9b3360d211624e8cbf542a7a65b2f5c6f3b33a (patch)
tree00c2387962f5daacc8bc8939916cc1a1eee7955c
parent9235e4c9a7d271d7add0c040d7303d92cdb6589c (diff)
downloadtcl-4a9b3360d211624e8cbf542a7a65b2f5c6f3b33a.zip
tcl-4a9b3360d211624e8cbf542a7a65b2f5c6f3b33a.tar.gz
tcl-4a9b3360d211624e8cbf542a7a65b2f5c6f3b33a.tar.bz2
[ed29c4da21] Completed fix for [chan copy] handling [chan blocked].
-rw-r--r--generic/tclIO.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 3d36d45..2810372 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -9020,7 +9020,7 @@ MBRead(
}
code = GetInput(inStatePtr->topChanPtr);
- if (code == 0) {
+ if (code == 0 || GotFlag(inStatePtr, CHANNEL_BLOCKED)) {
return TCL_OK;
} else {
MBError(csPtr, TCL_READABLE, code);
@@ -9270,6 +9270,10 @@ CopyData(
csPtr);
}
if (size == 0) {
+ if (!GotFlag(inStatePtr, CHANNEL_NONBLOCKING)) {
+ /* We allowed a short read. Keep trying. */
+ continue;
+ }
if (bufObj != NULL) {
TclDecrRefCount(bufObj);
bufObj = NULL;