summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/ProcessWin32.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2003-06-12 19:58:30 (GMT)
committerBrad King <brad.king@kitware.com>2003-06-12 19:58:30 (GMT)
commitef5214c6c52d81df38923feefd147dccb18200be (patch)
tree358ad2bb7a78fb01ea061526c5ae792afd77f92c /Source/kwsys/ProcessWin32.c
parentd92dcccb060dcd5e73fd27d9470972a5c5f76994 (diff)
downloadCMake-ef5214c6c52d81df38923feefd147dccb18200be.zip
CMake-ef5214c6c52d81df38923feefd147dccb18200be.tar.gz
CMake-ef5214c6c52d81df38923feefd147dccb18200be.tar.bz2
ERR: Using GetCurrentProcessId instead of _getpid so we don't need to include the system process.h header. Also creating pipe threads with 1K stacks to save memory.
Diffstat (limited to 'Source/kwsys/ProcessWin32.c')
-rw-r--r--Source/kwsys/ProcessWin32.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/kwsys/ProcessWin32.c b/Source/kwsys/ProcessWin32.c
index ecb703a..abe6b9e 100644
--- a/Source/kwsys/ProcessWin32.c
+++ b/Source/kwsys/ProcessWin32.c
@@ -38,7 +38,6 @@ Q190351 and Q150956.
#include <windows.h> /* Windows API */
#include <string.h> /* strlen, strdup */
#include <stdio.h> /* sprintf */
-#include <process.h> /* _getpid */
#include <io.h> /* _unlink */
/* The number of pipes for the child's output. The standard stdout
@@ -234,7 +233,7 @@ kwsysProcess* kwsysProcess_New()
/* Construct the executable name from the process id and kwsysProcess
instance. This should be unique. */
- sprintf(fwdName, "cmw9xfwd_%u_%p.exe", _getpid(), cp);
+ sprintf(fwdName, "cmw9xfwd_%u_%p.exe", GetCurrentProcessId(), cp);
/* If the environment variable "TEMP" gave us a directory, use it. */
if(length > 0 && length <= _MAX_PATH)
@@ -344,8 +343,10 @@ kwsysProcess* kwsysProcess_New()
return 0;
}
- /* Create the thread. It will block immediately. */
- if(!(cp->Pipe[i].Thread = CreateThread(0, 0, kwsysProcessPipeThread,
+ /* Create the thread. It will block immediately. The thread will
+ not make deeply nested calls, so we need only a small
+ stack. */
+ if(!(cp->Pipe[i].Thread = CreateThread(0, 1024, kwsysProcessPipeThread,
&cp->Pipe[i], 0, &dummy)))
{
kwsysProcess_Delete(cp);