diff options
author | dgp <dgp@users.sourceforge.net> | 2015-04-29 18:16:36 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2015-04-29 18:16:36 (GMT) |
commit | 78d5db0becaf8f571d450010dbe8de629fec9c0c (patch) | |
tree | b40395da2161164ea89e14bd07e59f6b3ef8e672 /generic | |
parent | 6dbe9b03d05e07bf7ece3e4910b09a5b109aa8e8 (diff) | |
parent | ade6c2a049cda62730309d282fdf9c65a5daf1c4 (diff) | |
download | tcl-78d5db0becaf8f571d450010dbe8de629fec9c0c.zip tcl-78d5db0becaf8f571d450010dbe8de629fec9c0c.tar.gz tcl-78d5db0becaf8f571d450010dbe8de629fec9c0c.tar.bz2 |
[894da183c8] Test and fix for regression in flushing blocked channels.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclIO.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index e46a22a..b97f57a 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -2657,6 +2657,8 @@ FlushChannel( * the post-condition that on a successful return to caller we've * left space in the current output buffer for more writing (the flush * call was to make new room). + * If the channel is blocking, then yes, so we guarantee that + * blocking flushes actually flush all pending data. * Otherwise, no. Keep the current output buffer where it is so more * can be written to it, possibly filling it, to promote more efficient * buffer usage. @@ -2664,7 +2666,8 @@ FlushChannel( bufPtr = statePtr->curOutPtr; if (bufPtr && BytesLeft(bufPtr) && /* Keep empties off queue */ - (statePtr->outQueueHead == NULL || IsBufferFull(bufPtr))) { + (statePtr->outQueueHead == NULL || IsBufferFull(bufPtr) + || !GotFlag(statePtr, CHANNEL_NONBLOCKING))) { if (statePtr->outQueueHead == NULL) { statePtr->outQueueHead = bufPtr; } else { |