summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-10-02 16:08:42 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-10-02 16:08:42 (GMT)
commit3f859f646f892cf849b650e0fefab36b9de837fa (patch)
tree58ef9c906fe94de732115171d7074352863f1917 /generic/tclIO.c
parent3c28c417ab57f3cee7f3a3fe146e835a86b8996e (diff)
downloadtcl-3f859f646f892cf849b650e0fefab36b9de837fa.zip
tcl-3f859f646f892cf849b650e0fefab36b9de837fa.tar.gz
tcl-3f859f646f892cf849b650e0fefab36b9de837fa.tar.bz2
Fix for core bug yet to be named/numbered.
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r--generic/tclIO.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 4e24533..0cb9fa9 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -879,19 +879,25 @@ CheckForStdChannelsBeingClosed(
ChannelState *statePtr = ((Channel *) chan)->state;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- if ((chan == tsdPtr->stdinChannel) && tsdPtr->stdinInitialized) {
+ if (tsdPtr->stdinInitialized
+ && tsdPtr->stdinChannel != NULL
+ && statePtr == ((Channel *)tsdPtr->stdinChannel)->state) {
if (statePtr->refCount < 2) {
statePtr->refCount = 0;
tsdPtr->stdinChannel = NULL;
return;
}
- } else if ((chan == tsdPtr->stdoutChannel) && tsdPtr->stdoutInitialized) {
+ } else if (tsdPtr->stdoutInitialized
+ && tsdPtr->stdoutChannel != NULL
+ && statePtr == ((Channel *)tsdPtr->stdoutChannel)->state) {
if (statePtr->refCount < 2) {
statePtr->refCount = 0;
tsdPtr->stdoutChannel = NULL;
return;
}
- } else if ((chan == tsdPtr->stderrChannel) && tsdPtr->stderrInitialized) {
+ } else if (tsdPtr->stderrInitialized
+ && tsdPtr->stderrChannel != NULL
+ && statePtr == ((Channel *)tsdPtr->stderrChannel)->state) {
if (statePtr->refCount < 2) {
statePtr->refCount = 0;
tsdPtr->stderrChannel = NULL;