Overview
| Artifact ID: | 639b8f587f3d0965e8bd40f154976fc5d3d150ee |
|---|---|
| Ticket: | 947693ffffffffffffffffffffffffffffffffff |
| Date: | 2004-06-03 02:49:10 |
| User: | davygrvy |
| Artifact Attached: | a564ebf09fb1722191b1ec15e2b08764801e5ee6 |
| Filename: | patch.txt |
| Description: | the fix #1 |
Content:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85Index: tclWinPipe.c =================================================================== RCS file: /cvsroot/tcl/tcl/win/tclWinPipe.c,v retrieving revision 1.48 diff -c -r1.48 tclWinPipe.c *** tclWinPipe.c 30 May 2004 21:57:09 -0000 1.48 --- tclWinPipe.c 2 Jun 2004 19:45:46 -0000 *************** *** 1884,1889 **** --- 1884,1891 ---- DWORD exitCode; errorCode = 0; + result = 0; + if ((!flags || (flags == TCL_CLOSE_READ)) && (pipePtr->readFile != NULL)) { /* *************** *** 2044,2067 **** } } ! /* ! * Wrap the error file into a channel and give it to the cleanup ! * routine. ! */ ! if (pipePtr->errorFile) { ! WinFile *filePtr; ! filePtr = (WinFile*)pipePtr->errorFile; ! errChan = Tcl_MakeFileChannel((ClientData) filePtr->handle, ! TCL_READABLE); ! ckfree((char *) filePtr); ! } else { ! errChan = NULL; ! } ! result = TclCleanupChildren(interp, pipePtr->numPids, pipePtr->pidPtr, ! errChan); if (pipePtr->numPids > 0) { ckfree((char *) pipePtr->pidPtr); --- 2046,2084 ---- } } ! if ((pipePtr->flags & PIPE_ASYNC) || TclInExit()) { ! /* ! * If the channel is non-blocking or Tcl is being cleaned up, just ! * detach the children PIDs, reap them (important if we are in a ! * dynamic load module), and discard the errorFile. ! */ ! ! Tcl_DetachPids(pipePtr->numPids, pipePtr->pidPtr); ! Tcl_ReapDetachedProcs(); ! ! if (pipePtr->errorFile) { ! TclpCloseFile(pipePtr->errorFile); ! } ! } else { ! /* ! * Wrap the error file into a channel and give it to the cleanup ! * routine. ! */ ! if (pipePtr->errorFile) { ! WinFile *filePtr; ! filePtr = (WinFile*)pipePtr->errorFile; ! errChan = Tcl_MakeFileChannel((ClientData) filePtr->handle, ! TCL_READABLE); ! ckfree((char *) filePtr); ! } else { ! errChan = NULL; ! } ! result = TclCleanupChildren(interp, pipePtr->numPids, pipePtr->pidPtr, ! errChan); ! } if (pipePtr->numPids > 0) { ckfree((char *) pipePtr->pidPtr);