summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2009-10-23 19:09:02 (GMT)
committerandreas_kupries <akupries@shaw.ca>2009-10-23 19:09:02 (GMT)
commit209270f72901889b717272fcb3a1cd80b76bcaca (patch)
tree94863f3bd004fdd79f99009e4d4c9b25c3892c3e /generic/tclIO.c
parent5bee8832da8316d97a5f398ae26de71558e108ce (diff)
downloadtcl-209270f72901889b717272fcb3a1cd80b76bcaca.zip
tcl-209270f72901889b717272fcb3a1cd80b76bcaca.tar.gz
tcl-209270f72901889b717272fcb3a1cd80b76bcaca.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>.
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r--generic/tclIO.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index a74cd04..fe5ea86 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.137.2.12 2009/10/19 21:59:18 dgp Exp $
+ * RCS: @(#) $Id: tclIO.c,v 1.137.2.13 2009/10/23 19:09:02 andreas_kupries Exp $
*/
#include "tclInt.h"
@@ -2314,8 +2314,12 @@ FlushChannel(
*/
toWrite = BytesLeft(bufPtr);
- written = (chanPtr->typePtr->outputProc)(chanPtr->instanceData,
+ if (toWrite == 0) {
+ written = 0;
+ } else {
+ written = (chanPtr->typePtr->outputProc)(chanPtr->instanceData,
RemovePoint(bufPtr), toWrite, &errorCode);
+ }
/*
* If the write failed completely attempt to start the asynchronous