From f00682186bc011c9dea0bb6125848af3af894c87 Mon Sep 17 00:00:00 2001 From: andreas_kupries Date: Fri, 23 Oct 2009 19:09:02 +0000 Subject: * 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 . --- ChangeLog | 7 +++++++ generic/tclIO.c | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0eec538..8338699 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-10-23 Andreas Kupries + + * 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 . + 2009-10-21 Donal K. Fellows * generic/tclPosixStr.c: [Bug 2882561]: Work around oddity on Haiku OS 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 -- cgit v0.12