summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2009-10-23 19:09:17 (GMT)
committerandreas_kupries <akupries@shaw.ca>2009-10-23 19:09:17 (GMT)
commit4c918aeb8891267ba470fbb2734bc5f0f711df00 (patch)
tree468029f1bc0a420285d97f260766460c10a27ed0
parenta14cd9979de8b9856c979aae40f3c8889b2d8d9b (diff)
downloadtcl-4c918aeb8891267ba470fbb2734bc5f0f711df00.zip
tcl-4c918aeb8891267ba470fbb2734bc5f0f711df00.tar.gz
tcl-4c918aeb8891267ba470fbb2734bc5f0f711df00.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--ChangeLog7
-rw-r--r--generic/tclIO.c8
2 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 42b3dd3..47f0a53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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-22 Donal K. Fellows <dkf@users.sf.net>
* generic/tclOOBasic.c (TclOO_Object_VarName): [Bug 2883857]: Allow
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 28e9fbc..57960f5 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.163 2009/10/19 22:00:19 dgp Exp $
+ * RCS: @(#) $Id: tclIO.c,v 1.164 2009/10/23 19:09:17 andreas_kupries Exp $
*/
#include "tclInt.h"
@@ -2393,7 +2393,11 @@ FlushChannel(
*/
toWrite = BytesLeft(bufPtr);
- written = ChanWrite(chanPtr, RemovePoint(bufPtr),toWrite, &errorCode);
+ if (toWrite == 0) {
+ written = 0;
+ } else {
+ written = ChanWrite(chanPtr, RemovePoint(bufPtr),toWrite, &errorCode);
+ }
/*
* If the write failed completely attempt to start the asynchronous