From d3f9c73dc264653b77c07b13e23dd25d3241c8f5 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 5 Sep 2003 12:27:30 +0000 Subject: [PATCH] Stupid braindamaged OSs that screw ESRCH... PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@101157 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/alloc.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/alloc.c b/src/main/alloc.c index 4201564ef0e..98f8af1d196 100644 --- a/src/main/alloc.c +++ b/src/main/alloc.c @@ -2858,11 +2858,14 @@ static void free_proc_chain(struct process_chain *procs) for (p = procs; p; p = p->next) { if ((p->kill_how == kill_after_timeout) || (p->kill_how == kill_only_once)) { - /* Subprocess may be dead already. Only need the timeout if not. */ - if ( (ap_os_kill(p->pid, SIGTERM) == -1) && (errno == ESRCH) ) - p->kill_how = kill_never; - else - need_timeout = 1; + /* + * This is totally bogus, but seems to be the + * only portable (as in reliable) way to accomplish + * this. Note that this implies an unavoidable + * delay. + */ + ap_os_kill(p->pid, SIGTERM); + need_timeout = 1; } else if (p->kill_how == kill_always) { kill(p->pid, SIGKILL); -- 2.47.2