aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Stoddard <stoddard@apache.org>2000-01-28 02:24:15 +0000
committerBill Stoddard <stoddard@apache.org>2000-01-28 02:24:15 +0000
commit33699965e9ad86976b0339fc02b1804cb2bbcbcc (patch)
treea75035a5daa898fc0d0214ee0791053157b06cd4
parentdad1e6e89a8a9fd3f8c7095e7be6f927ea45bb79 (diff)
downloadapr-33699965e9ad86976b0339fc02b1804cb2bbcbcc.tar.gz
apr-33699965e9ad86976b0339fc02b1804cb2bbcbcc.zip
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: https://svn.apache.org/repos/asf/apr/apr/trunk@59627 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--threadproc/win32/proc.c9
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)