stoddard 01/07/12 10:30:16
Modified: threadproc/win32 proc.c
Log:
Set the DETACHED_PROCESS creation flag
Revision Changes Path
1.46 +13 -6 apr/threadproc/win32/proc.c
Index: proc.c
===================================================================
RCS file: /home/cvs/apr/threadproc/win32/proc.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- proc.c 2001/05/16 05:33:27 1.45
+++ proc.c 2001/07/12 17:30:14 1.46
@@ -317,11 +317,11 @@
*/
APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new,
- const char *progname,
- const char * const *args,
- const char * const *env,
- apr_procattr_t *attr,
- apr_pool_t *cont)
+ const char *progname,
+ const char * const *args,
+ const char * const *env,
+ apr_procattr_t *attr,
+ apr_pool_t *cont)
{
apr_size_t i, iEnvBlockLen;
char *cmdline;
@@ -329,6 +329,7 @@
char *envstr;
char *pEnvBlock, *pNext;
PROCESS_INFORMATION pi;
+ DWORD dwCreationFlags = 0;
new->in = attr->parent_in;
new->err = attr->parent_err;
@@ -340,6 +341,7 @@
* window we are starting in. And we had better redfine our
* handles for STDIN, STDOUT, and STDERR.
*/
+ dwCreationFlags |= DETACHED_PROCESS;
attr->si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
attr->si.wShowWindow = SW_HIDE;
@@ -427,7 +429,12 @@
}
- if (CreateProcess(NULL, cmdline, NULL, NULL, TRUE, 0, pEnvBlock,
attr->currdir,
+ if (CreateProcess(NULL, cmdline, /* Command line */
+ NULL, NULL, /* Proc & thread security
attributes */
+ TRUE, /* Inherit handles */
+ dwCreationFlags, /* Creation flags */
+ pEnvBlock, /* Environment block */
+ attr->currdir, /* Current directory name */
&attr->si, &pi)) {
// TODO: THIS IS BADNESS