Tcl Source Code

Check-in [1b7584406b]
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-4-branch
Files: files | file ages | folders
SHA1: 1b7584406b08b67f566d79ba6c98feb3a80626e9
User & Date: dgp 2012-10-03 15:22:15
Context
2012-10-24
11:14
Add dummy 0 parameter (unused flags) to internal Tcl_FSLoadFileProc call, for upwards compatibility... check-in: bf7740a5d3 user: jan.nijtmans tags: core-8-4-branch
2012-10-03
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:23
merge 8.4 check-in: 6c5323d5b6 user: dgp tags: bug-3567063
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-08-17
07:16
nmakehlp: Add "-V<num>" option, in order to be able to detect partial version numbers. check-in: 3f8069f0b4 user: jan.nijtmans tags: core-8-4-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.







1
2
3
4
5
6
7






2012-08-17  Jan Nijtmans  <[email protected]>

	* win/nmakehlp.c: Add "-V<num>" option, in order to be able
	to detect partial version numbers.

2012-07-31  Jan Nijtmans  <[email protected]>

>
>
>
>
>
>







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-08-17  Jan Nijtmans  <[email protected]>

	* win/nmakehlp.c: Add "-V<num>" option, in order to be able
	to detect partial version numbers.

2012-07-31  Jan Nijtmans  <[email protected]>

Changes to generic/tclIO.c.

693
694
695
696
697
698
699
700


701
702
703
704
705

706
707
708
709
710
711
712

713
714
715
716
717
718
719
720
721
722
723
724
725
726
static void
CheckForStdChannelsBeingClosed(chan)
    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;
        }
    }
}

/*
 *----------------------------------------------------------------------
 *
 * Tcl_IsStandardChannel --







|
>
>
|
|
|
|
|
>
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|







693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
static void
CheckForStdChannelsBeingClosed(chan)
    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;
	}
    }
}

/*
 *----------------------------------------------------------------------
 *
 * Tcl_IsStandardChannel --