summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@noemail.net>2014-10-10 19:44:54 (GMT)
committerdgp <dgp@noemail.net>2014-10-10 19:44:54 (GMT)
commite653811504a236419fa4eca3b32c6201b2b4f8c4 (patch)
tree3d659581f9cad7f2e5256296282f77046081b869 /generic
parent3a8625886d1b273452c005cb6f07761a36eaaeba (diff)
downloadtcl-e653811504a236419fa4eca3b32c6201b2b4f8c4.zip
tcl-e653811504a236419fa4eca3b32c6201b2b4f8c4.tar.gz
tcl-e653811504a236419fa4eca3b32c6201b2b4f8c4.tar.bz2
[ed29c4da21] Completed fix for [chan copy] handling [chan blocked].
FossilOrigin-Name: b71be3e49eabf6c0bb998aca60e61d7abe98dc0f
Diffstat (limited to 'generic')
-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;