Tcl Source Code

Check-in [00425ee7d7]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:When checking for std channels being closed, compare the channel state, not the channel itself so that stacked channels do not cause trouble.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: 00425ee7d72a2f064b94669698e4af47c7b2ab21
User & Date: dgp 2012-10-03 15:29:59
Context
2012-10-13
20:26
Bug 3576509: tcl::Bgerror crashes with invalid arguments check-in: 8250ea2509 user: jan.nijtmans tags: core-8-5-branch
2012-10-03
15:39
When checking for std channels being closed, compare the channel state, not the channel itself so th... check-in: 986eb391ad user: dgp tags: trunk
15:29
When checking for std channels being closed, compare the channel state, not the channel itself so th... check-in: 00425ee7d7 user: dgp tags: core-8-5-branch
15:22
When checking for std channels being closed, compare the channel state, not the channel itself so th... check-in: 1b7584406b user: dgp tags: core-8-4-branch
2012-09-25
12:59
tip#404 file locale mcset: mc(fl)(m)set backport from 8.6 check-in: 2806b288e6 user: oehhar tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.







1
2
3
4
5
6
7






2012-09-07  Harald Oehlmann  <[email protected]>

	IMPLEMENTATION OF TIP#404.

	* library/msgcat/msgcat.tcl:	[FRQ 3544988]: (Backport from Tcl 8.6)
	* library/msgcat/pkgIndex.tcl:	New commands [mcflset] and [mcflmset]
	* unix/Makefile.in:		to set mc entries with implicit message
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
2012-10-03  Don Porter  <[email protected]>

	* generic/tclIO.c:	When checking for std channels being closed,
	compare the channel state, not the channel itself so that stacked
	channels do not cause trouble.

2012-09-07  Harald Oehlmann  <[email protected]>

	IMPLEMENTATION OF TIP#404.

	* library/msgcat/msgcat.tcl:	[FRQ 3544988]: (Backport from Tcl 8.6)
	* library/msgcat/pkgIndex.tcl:	New commands [mcflset] and [mcflmset]
	* unix/Makefile.in:		to set mc entries with implicit message

Changes to generic/tclIO.c.

744
745
746
747
748
749
750
751


752
753
754
755
756

757
758
759
760
761
762
763

764
765
766
767
768
769
770
771
772
static void
CheckForStdChannelsBeingClosed(
    Tcl_Channel chan)
{
    ChannelState *statePtr = ((Channel *) chan)->state;
    ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);

    if ((chan == tsdPtr->stdinChannel) && (tsdPtr->stdinInitialized)) {


	if (statePtr->refCount < 2) {
	    statePtr->refCount = 0;
	    tsdPtr->stdinChannel = NULL;
	    return;
	}

    } else if ((chan == tsdPtr->stdoutChannel)
	    && (tsdPtr->stdoutInitialized)) {
	if (statePtr->refCount < 2) {
	    statePtr->refCount = 0;
	    tsdPtr->stdoutChannel = NULL;
	    return;
	}

    } else if ((chan == tsdPtr->stderrChannel)
	    && (tsdPtr->stderrInitialized)) {
	if (statePtr->refCount < 2) {
	    statePtr->refCount = 0;
	    tsdPtr->stderrChannel = NULL;
	    return;
	}
    }
}







|
>
>





>
|
|





>
|
|







744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
static void
CheckForStdChannelsBeingClosed(
    Tcl_Channel chan)
{
    ChannelState *statePtr = ((Channel *) chan)->state;
    ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);

    if (tsdPtr->stdinInitialized
	    && tsdPtr->stdinChannel != NULL
	    && statePtr == ((Channel *)tsdPtr->stdinChannel)->state) {
	if (statePtr->refCount < 2) {
	    statePtr->refCount = 0;
	    tsdPtr->stdinChannel = NULL;
	    return;
	}
    } 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 (tsdPtr->stderrInitialized
	    && tsdPtr->stderrChannel != NULL
	    && statePtr == ((Channel *)tsdPtr->stderrChannel)->state) {
	if (statePtr->refCount < 2) {
	    statePtr->refCount = 0;
	    tsdPtr->stderrChannel = NULL;
	    return;
	}
    }
}