summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-06-02 20:03:14 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-06-02 20:03:14 (GMT)
commitabb4df1befac97bab990b6aefbbb6c21d330eb08 (patch)
treea7121fb462da5136135109fa4c8d034d27cd05fd /generic
parentc564e71550c301b91656eb54602bb8c1ece62f01 (diff)
downloadtcl-abb4df1befac97bab990b6aefbbb6c21d330eb08.zip
tcl-abb4df1befac97bab990b6aefbbb6c21d330eb08.tar.gz
tcl-abb4df1befac97bab990b6aefbbb6c21d330eb08.tar.bz2
These edits make the tests socket-14.11.[01] stop hanging, but also introduce
a whole raft of test failures. WIP.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclIO.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 7d94037..5552329 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -3288,10 +3288,15 @@ Tcl_Close(
stickyError = 0;
if ((statePtr->encoding != NULL)
- && !(statePtr->outputEncodingFlags & TCL_ENCODING_START)
- && (CheckChannelErrors(statePtr, TCL_WRITABLE) == 0)) {
- statePtr->outputEncodingFlags |= TCL_ENCODING_END;
- if (WriteChars(chanPtr, "", 0) < 0) {
+ && !(statePtr->outputEncodingFlags & TCL_ENCODING_START)) {
+
+ int code = CheckChannelErrors(statePtr, TCL_WRITABLE);
+
+ if (code == 0) {
+ statePtr->outputEncodingFlags |= TCL_ENCODING_END;
+ code = WriteChars(chanPtr, "", 0);
+ }
+ if (code < 0) {
stickyError = Tcl_GetErrno();
}
@@ -8034,8 +8039,9 @@ Tcl_NotifyChannel(
*/
if (GotFlag(statePtr, BG_FLUSH_SCHEDULED) && (mask & TCL_WRITABLE)) {
- FlushChannel(NULL, chanPtr, 1);
- mask &= ~TCL_WRITABLE;
+ if (0 == FlushChannel(NULL, chanPtr, 1)) {
+ mask &= ~TCL_WRITABLE;
+ }
}
/*