summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorf.bonnet <f.bonnet>2017-08-27 15:24:22 (GMT)
committerf.bonnet <f.bonnet>2017-08-27 15:24:22 (GMT)
commit935e991786520c81b01c7c2992568703d3d0746f (patch)
tree903292ee6915eeea9a5b3ceebbb72f6e9d2e5163
parent43c89a019c37b43637956e0b21b5788f784b1972 (diff)
downloadtcl-935e991786520c81b01c7c2992568703d3d0746f.zip
tcl-935e991786520c81b01c7c2992568703d3d0746f.tar.gz
tcl-935e991786520c81b01c7c2992568703d3d0746f.tar.bz2
On Windows, Tcl_Pids now map to dwProcessId instead of hProcess because the system reuses handles of recently terminated processes.
-rw-r--r--win/tclWinPipe.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 4666deb..ce132d1 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -876,7 +876,7 @@ TclpGetPid(
Tcl_MutexLock(&pipeMutex);
for (infoPtr = procList; infoPtr != NULL; infoPtr = infoPtr->nextPtr) {
- if (infoPtr->hProcess == (HANDLE) pid) {
+ if (infoPtr->dwProcessId == (DWORD) pid) {
Tcl_MutexUnlock(&pipeMutex);
return infoPtr->dwProcessId;
}
@@ -1187,7 +1187,7 @@ TclpCreateProcess(
WaitForInputIdle(procInfo.hProcess, 5000);
CloseHandle(procInfo.hThread);
- *pidPtr = (Tcl_Pid) procInfo.hProcess;
+ *pidPtr = (Tcl_Pid) procInfo.dwProcessId;
if (*pidPtr != 0) {
TclWinAddProcess(procInfo.hProcess, procInfo.dwProcessId);
}
@@ -2458,7 +2458,7 @@ Tcl_WaitPid(
prevPtrPtr = &procList;
for (infoPtr = procList; infoPtr != NULL;
prevPtrPtr = &infoPtr->nextPtr, infoPtr = infoPtr->nextPtr) {
- if (infoPtr->hProcess == (HANDLE) pid) {
+ if (infoPtr->dwProcessId == (DWORD) pid) {
*prevPtrPtr = infoPtr->nextPtr;
break;
}