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 /generic/tclIO.c | |
parent | 4229e3c1ff708b65c55ee82c5fec89259c461d7b (diff) | |
download | tcl-abdeb8de335b3ad784fed7e0338bcfc9cbd3d99e.zip tcl-abdeb8de335b3ad784fed7e0338bcfc9cbd3d99e.tar.gz tcl-abdeb8de335b3ad784fed7e0338bcfc9cbd3d99e.tar.bz2 |
Properly close nonblocking channels even when not flushing them.
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r-- | generic/tclIO.c | 6 |
1 files changed, 3 insertions, 3 deletions
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); /* |