From cbfa148c07564de2584021eb51e20bab1da7ca2b Mon Sep 17 00:00:00 2001 From: stoddard Date: Fri, 28 Jan 2000 02:24:15 +0000 Subject: Fix some return codes and leave the new process handle open. In general, the parent process should explicitly close the handle if it does not need it. And Apache requires the handle for free_proc_chain clean-up processing. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@59627 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/win32/proc.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c index 4b5a8666d..53996699c 100644 --- a/threadproc/win32/proc.c +++ b/threadproc/win32/proc.c @@ -364,9 +364,6 @@ ap_status_t ap_create_process(struct proc_t **new, const char *progname, if (CreateProcess(NULL, cmdline, NULL, NULL, TRUE, 0, pEnvBlock, attr->currdir, &attr->si, &(*new)->pi)) { - if (attr->detached) { - CloseHandle((*new)->pi.hProcess); - } if (attr->child_in) { ap_close(attr->child_in); } @@ -404,7 +401,7 @@ ap_status_t ap_get_childerr(ap_file_t **new, struct proc_t *proc) ap_status_t ap_wait_proc(struct proc_t *proc, ap_wait_how_e wait) { - pid_t stat; + DWORD stat; if (!proc) return APR_ENOPROC; if (wait == APR_WAIT) { @@ -414,7 +411,7 @@ ap_status_t ap_wait_proc(struct proc_t *proc, else if (stat == WAIT_TIMEOUT) { return APR_CHILD_NOTDONE; } - return APR_EEXIST; + return GetLastError(); } if ((stat = WaitForSingleObject(proc->pi.hProcess, 0)) == WAIT_OBJECT_0) { return APR_CHILD_DONE; @@ -422,7 +419,7 @@ ap_status_t ap_wait_proc(struct proc_t *proc, else if (stat == WAIT_TIMEOUT) { return APR_CHILD_NOTDONE; } - return APR_EEXIST; + return GetLastError(); } ap_status_t ap_get_procdata(char *key, void *data, struct proc_t *proc) -- cgit v1.2.1