summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tclPipe.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/generic/tclPipe.c b/generic/tclPipe.c
index 5365047..7d1334d 100644
--- a/generic/tclPipe.c
+++ b/generic/tclPipe.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclPipe.c,v 1.6 2002/02/15 14:28:49 dkf Exp $
+ * RCS: @(#) $Id: tclPipe.c,v 1.7 2002/12/17 02:47:39 davygrvy Exp $
*/
#include "tclInt.h"
@@ -280,9 +280,17 @@ TclCleanupChildren(interp, numPids, pidPtr, errorChan)
Tcl_Pid pid;
WAIT_STATUS_TYPE waitStatus;
CONST char *msg;
+ unsigned long resolvedPid;
abnormalExit = 0;
for (i = 0; i < numPids; i++) {
+ /*
+ * We need to get the resolved pid before we wait on it as
+ * the windows implimentation of Tcl_WaitPid deletes the
+ * information such that any following calls to TclpGetPid
+ * fail.
+ */
+ resolvedPid = TclpGetPid(pidPtr[i]);
pid = Tcl_WaitPid(pidPtr[i], (int *) &waitStatus, 0);
if (pid == (Tcl_Pid) -1) {
result = TCL_ERROR;
@@ -315,7 +323,7 @@ TclCleanupChildren(interp, numPids, pidPtr, errorChan)
char msg1[TCL_INTEGER_SPACE], msg2[TCL_INTEGER_SPACE];
result = TCL_ERROR;
- TclFormatInt(msg1, (long) TclpGetPid(pid));
+ TclFormatInt(msg1, (long) resolvedPid);
if (WIFEXITED(waitStatus)) {
if (interp != (Tcl_Interp *) NULL) {
TclFormatInt(msg2, WEXITSTATUS(waitStatus));