diff options
author | stoddard <stoddard@13f79535-47bb-0310-9956-ffa450edef68> | 2000-01-28 02:24:15 +0000 |
---|---|---|
committer | stoddard <stoddard@13f79535-47bb-0310-9956-ffa450edef68> | 2000-01-28 02:24:15 +0000 |
commit | cbfa148c07564de2584021eb51e20bab1da7ca2b (patch) | |
tree | a75035a5daa898fc0d0214ee0791053157b06cd4 | |
parent | 809181bbbb1b0d085c79a08f9b25387a80e205fc (diff) | |
download | libapr-cbfa148c07564de2584021eb51e20bab1da7ca2b.tar.gz |
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
-rw-r--r-- | threadproc/win32/proc.c | 9 |
1 files 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) |