diff options
author | dgp <dgp@users.sourceforge.net> | 2014-05-31 02:40:00 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-05-31 02:40:00 (GMT) |
commit | 46ab1371a7cbd2e6d244d043a47d5123a716be33 (patch) | |
tree | 8772939968bbf992cb7f11d20a0a235c7cd4c691 /generic | |
parent | a317bfbe0735d86682ee279cd1359576169bb8db (diff) | |
parent | ea994aa1957bd3faea8f4cdf2ae290d102ae1fe8 (diff) | |
download | tcl-46ab1371a7cbd2e6d244d043a47d5123a716be33.zip tcl-46ab1371a7cbd2e6d244d043a47d5123a716be33.tar.gz tcl-46ab1371a7cbd2e6d244d043a47d5123a716be33.tar.bz2 |
Correct the interest masks in the Tcl_CreateFileHandler() calls in PipeWatchProc(). When we are interested in both readable and writable events of a command pipeline channel, we only want the readable from the read end of the pipe, and the writable from the write end of the pipe.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclIO.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index d356e11..7d94037 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -2777,11 +2777,18 @@ FlushChannel( ResetFlag(statePtr, BG_FLUSH_SCHEDULED); ChanWatch(chanPtr, statePtr->interestMask); } else { - /* TODO: If code reaches this point, it means a writable - * event is being handled on the channel, but the channel - * could not in fact be written to. This ought not happen, - * but Unix pipes appear to act this way (see io-53.4). - * Also can imagine broken reflected channels. */ + + /* + * When we are calledFromAsyncFlush, that means a writable + * state on the channel triggered the call, so we should be + * able to write something. Either we did write something + * and wroteSome should be set, or there was nothing left to + * write in this call, and we've completed the BG flush. + * These are the two cases above. If we get here, that means + * there is some kind failure in the writable event machinery. + */ + + assert(!calledFromAsyncFlush); } } |