summaryrefslogtreecommitdiff
path: root/memory/unix/apr_pools.c
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2003-02-27 19:13:48 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2003-02-27 19:13:48 +0000
commit27b50d1f4df34995aaa0f0638ed91788ae805f44 (patch)
treef69732fc7930cfc5ebef670569625edd237b4e83 /memory/unix/apr_pools.c
parentdf9eb9c6679d284355e5d90c1fdafad5bb60030b (diff)
downloadlibapr-27b50d1f4df34995aaa0f0638ed91788ae805f44.tar.gz
As near as I can tell, Win32 will now correspond to Unix in terms of the
availability and lifetime of the hproc process handle. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64388 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'memory/unix/apr_pools.c')
-rw-r--r--memory/unix/apr_pools.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
index 25ddbd9ef..0338233e2 100644
--- a/memory/unix/apr_pools.c
+++ b/memory/unix/apr_pools.c
@@ -2066,6 +2066,7 @@ static void free_proc_chain(struct process_chain *procs)
#endif /* !defined(NEED_WAITPID) */
for (pc = procs; pc; pc = pc->next) {
+#ifndef WIN32
if ((pc->kill_how == APR_KILL_AFTER_TIMEOUT)
|| (pc->kill_how == APR_KILL_ONLY_ONCE)) {
/*
@@ -2074,14 +2075,15 @@ static void free_proc_chain(struct process_chain *procs)
* similar to a SIGKILL, so always give the process a timeout
* under Windows before killing it.
*/
-#ifdef WIN32
- need_timeout = 1;
-#else /* !defined(WIN32) */
if (apr_proc_kill(pc->proc, SIGTERM) == APR_SUCCESS)
need_timeout = 1;
-#endif /* !defined(WIN32) */
}
else if (pc->kill_how == APR_KILL_ALWAYS) {
+#else /* WIN32 knows only one fast, clean method of killing processes today */
+ if (pc->kill_how != APR_KILL_NEVER) {
+ need_timeout = 1;
+ pc->kill_how = APR_KILL_ALWAYS;
+#endif
apr_proc_kill(pc->proc, SIGKILL);
}
}
@@ -2130,23 +2132,6 @@ static void free_proc_chain(struct process_chain *procs)
if (pc->kill_how != APR_KILL_NEVER)
(void)apr_proc_wait(pc->proc, NULL, NULL, APR_WAIT);
}
-
-#ifdef WIN32
- /*
- * XXX: Do we need an APR function to clean-up a proc_t?
- * Well ... yeah ... but we can't since it's scope is ill defined.
- * We can't dismiss the handle until the apr_proc_wait above is
- * finished with the proc_t.
- */
- {
- for (pc = procs; pc; pc = pc->next) {
- if (pc->proc->hproc) {
- CloseHandle(pc->proc->hproc);
- pc->proc->hproc = NULL;
- }
- }
- }
-#endif /* defined(WIN32) */
}