summaryrefslogtreecommitdiffstats
path: root/win/tclWinPipe.c
diff options
context:
space:
mode:
authorstanton <stanton>1999-03-11 00:19:23 (GMT)
committerstanton <stanton>1999-03-11 00:19:23 (GMT)
commit959ef2397770f8b6b7319b28c4cee7ef60ba6ac4 (patch)
tree5395cacc9a5253542d062dfcb57426a2721a541b /win/tclWinPipe.c
parent17d56fd5b956aa638c25faaac51a8856ee8f51d7 (diff)
downloadtcl-959ef2397770f8b6b7319b28c4cee7ef60ba6ac4.zip
tcl-959ef2397770f8b6b7319b28c4cee7ef60ba6ac4.tar.gz
tcl-959ef2397770f8b6b7319b28c4cee7ef60ba6ac4.tar.bz2
* win/tclWinPipe.c:
* generic/tclInt.decls: Added TclWinAddProcess to make it possible for expect to use Tcl_WaitForPid(). This patch is from Gordon Chaffee. * mac/tclMacPort.h: * win/tclWinInit.c: * unix/tclUnixPort.h: * generic/tclAsync.c: Added TclpAsyncMark to fix bug in async handling on Windows where async events don't wake up the event loop. This patch comes from Gordon Chaffee. * generic/tcl.decls: Fixed declarations of reserved slots.
Diffstat (limited to 'win/tclWinPipe.c')
-rw-r--r--win/tclWinPipe.c44
1 files changed, 33 insertions, 11 deletions
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 76695e0..8194f64 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinPipe.c,v 1.3 1998/09/14 18:40:20 stanton Exp $
+ * RCS: @(#) $Id: tclWinPipe.c,v 1.4 1999/03/11 00:19:24 stanton Exp $
*/
#include "tclWinInt.h"
@@ -998,11 +998,7 @@ TclpCreateProcess(interp, argc, argv, inputFile, outputFile, errorFile,
}
*pidPtr = (Tcl_Pid) procInfo.hProcess;
if (*pidPtr != 0) {
- ProcInfo *procPtr = (ProcInfo *) ckalloc(sizeof(ProcInfo));
- procPtr->hProcess = procInfo.hProcess;
- procPtr->dwProcessId = procInfo.dwProcessId;
- procPtr->nextPtr = procList;
- procList = procPtr;
+ TclWinAddProcess(procInfo.hProcess, procInfo.dwProcessId);
}
result = TCL_OK;
}
@@ -1303,11 +1299,7 @@ TclpCreateProcess(interp, argc, argv, inputFile, outputFile, errorFile,
*pidPtr = (Tcl_Pid) procInfo.hProcess;
if (*pidPtr != 0) {
- ProcInfo *procPtr = (ProcInfo *) ckalloc(sizeof(ProcInfo));
- procPtr->hProcess = procInfo.hProcess;
- procPtr->dwProcessId = procInfo.dwProcessId;
- procPtr->nextPtr = procList;
- procList = procPtr;
+ TclWinAddProcess(procInfo.hProcess, procInfo.dwProcessId);
}
result = TCL_OK;
@@ -2416,6 +2408,36 @@ Tcl_WaitPid(pid, statPtr, options)
/*
*----------------------------------------------------------------------
*
+ * TclWinAddProcess --
+ *
+ * Add a process to the process list so that we can use
+ * Tcl_WaitPid on the process.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * Adds the specified process handle to the process list so
+ * Tcl_WaitPid knows about it.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TclWinAddProcess(hProcess, id)
+ HANDLE hProcess; /* Handle to process */
+ DWORD id; /* Global process identifier */
+{
+ ProcInfo *procPtr = (ProcInfo *) ckalloc(sizeof(ProcInfo));
+ procPtr->hProcess = hProcess;
+ procPtr->dwProcessId = id;
+ procPtr->nextPtr = procList;
+ procList = procPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* Tcl_PidObjCmd --
*
* This procedure is invoked to process the "pid" Tcl command.