summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-10-04 08:25:52 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-10-04 08:25:52 (GMT)
commitd9ec510026ac166ce0732f7a77573654e7ab2410 (patch)
tree7ebd338853b7207ceb8b25bda783dcceadf6fe12 /generic
parent26529fbec2cc37660e2f376993a1098b4d95404a (diff)
parentbfd2f2fbf7a0c7fb68ded3c44b169cb5ce97c24f (diff)
downloadtcl-d9ec510026ac166ce0732f7a77573654e7ab2410.zip
tcl-d9ec510026ac166ce0732f7a77573654e7ab2410.tar.gz
tcl-d9ec510026ac166ce0732f7a77573654e7ab2410.tar.bz2
merge trunk
Diffstat (limited to 'generic')
-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;