diff options
author | andreas_kupries <akupries@shaw.ca> | 2009-10-23 19:08:44 (GMT) |
---|---|---|
committer | andreas_kupries <akupries@shaw.ca> | 2009-10-23 19:08:44 (GMT) |
commit | 75ce8fa7e5928f9d367eb369c9d28d367610c8c4 (patch) | |
tree | 2109da7eb4d642c73dcff2082b77795c03f0711a | |
parent | cc2845ac3d81d4df5579c8fbcbfdc97d838b5a53 (diff) | |
download | tcl-75ce8fa7e5928f9d367eb369c9d28d367610c8c4.zip tcl-75ce8fa7e5928f9d367eb369c9d28d367610c8c4.tar.gz tcl-75ce8fa7e5928f9d367eb369c9d28d367610c8c4.tar.bz2 |
* generic/tclIO.c (FlushChannel): Skip OutputProc for low-level
0-length writes. When closing pipes which have already been closed
not skipping leads to spurious SIG_PIPE signals. Reported by
Mikhail Teterin <mi+thun@aldan.algebra.com>.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | generic/tclIO.c | 8 |
2 files changed, 13 insertions, 2 deletions
@@ -1,3 +1,10 @@ +2009-10-23 Andreas Kupries <andreask@activestate.com> + + * generic/tclIO.c (FlushChannel): Skip OutputProc for low-level + 0-length writes. When closing pipes which have already been closed + not skipping leads to spurious SIG_PIPE signals. Reported by + Mikhail Teterin <mi+thun@aldan.algebra.com>. + 2009-10-21 Donal K. Fellows <dkf@users.sf.net> * generic/tclPosixStr.c: [Bug 2882561]: Work around oddity on Haiku OS diff --git a/generic/tclIO.c b/generic/tclIO.c index 8e00054..11cb205 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIO.c,v 1.61.2.32 2008/12/01 21:48:01 dgp Exp $ + * RCS: @(#) $Id: tclIO.c,v 1.61.2.33 2009/10/23 19:08:45 andreas_kupries Exp $ */ #include "tclInt.h" @@ -2131,9 +2131,13 @@ FlushChannel(interp, chanPtr, calledFromAsyncFlush) */ toWrite = bufPtr->nextAdded - bufPtr->nextRemoved; - written = (chanPtr->typePtr->outputProc) (chanPtr->instanceData, + if (toWrite == 0) { + written = 0; + } else { + written = (chanPtr->typePtr->outputProc) (chanPtr->instanceData, bufPtr->buf + bufPtr->nextRemoved, toWrite, &errorCode); + } /* * If the write failed completely attempt to start the asynchronous |