diff options
author | ferrieux <ferrieux@users.sourceforge.net> | 2012-05-07 16:36:43 (GMT) |
---|---|---|
committer | ferrieux <ferrieux@users.sourceforge.net> | 2012-05-07 16:36:43 (GMT) |
commit | abdeb8de335b3ad784fed7e0338bcfc9cbd3d99e (patch) | |
tree | 37d41115d0b3d5efda1ea0a1f7a527dc61199cf9 | |
parent | 4229e3c1ff708b65c55ee82c5fec89259c461d7b (diff) | |
download | tcl-abdeb8de335b3ad784fed7e0338bcfc9cbd3d99e.zip tcl-abdeb8de335b3ad784fed7e0338bcfc9cbd3d99e.tar.gz tcl-abdeb8de335b3ad784fed7e0338bcfc9cbd3d99e.tar.bz2 |
Properly close nonblocking channels even when not flushing them.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tclIO.c | 6 |
2 files changed, 8 insertions, 3 deletions
@@ -1,3 +1,8 @@ +2012-04-28 Alexandre Ferrieux <ferrieux@users.sourceforge.net> + + * generic/tclIO.c: Properly close nonblocking channels even when + not flushing them. + 2012-05-03 Jan Nijtmans <nijtmans@users.sf.net> * compat/zlib/*: Upgrade to zlib 1.2.7 (pre-built dll is still 1.2.5, diff --git a/generic/tclIO.c b/generic/tclIO.c index b06c14d..86ee6ed 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -428,14 +428,15 @@ TclFinalizeIOSubsystem(void) statePtr = statePtr->nextCSPtr) { chanPtr = statePtr->topChanPtr; if (!GotFlag(statePtr, CHANNEL_INCLOSE | CHANNEL_CLOSED | CHANNEL_DEAD) - || (doflushnb && GotFlag(statePtr, BG_FLUSH_SCHEDULED))) { + || GotFlag(statePtr, BG_FLUSH_SCHEDULED)) { + ResetFlag(statePtr, BG_FLUSH_SCHEDULED); active = 1; break; } } /* - * We've found a live channel. Close it. + * We've found a live (or bg-closing) channel. Close it. */ if (active) { @@ -479,7 +480,6 @@ TclFinalizeIOSubsystem(void) * The refcount is greater than zero, so flush the channel. */ - ResetFlag(statePtr, BG_FLUSH_SCHEDULED); Tcl_Flush((Tcl_Channel) chanPtr); /* |