Index: alloc.c
===================================================================
RCS file: /e/apache/cvs/apache-1.3/src/main/alloc.c,v
retrieving revision 1.145
diff -u -d -r1.145 alloc.c
--- alloc.c 20 Jun 2003 15:05:40 -0000 1.145
+++ alloc.c 29 Jul 2003 19:07:46 -0000
@@ -2859,12 +2859,8 @@
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) {
- p->kill_how = kill_never;
- }
- else {
- need_timeout = 1;
- }
+ ap_os_kill(p->pid, SIGTERM);
+ need_timeout = 1;
The drawback of this is that often* when suexec is not in use we end up burning extra syscalls when it is not necessary.
*"often" is speculation and not something I've tested
If it were instead:
if (ap_os_kill(p->pid, SIGTERM) == -1 &&
errno == ESRCH) {
p->kill_how = skip_timeout; /* some new value */
}
else {
need_timeout = 1;
}we'd still do the waitpid() at the end but we wouldn't insert a needless timeout loop when we know this child is a goner.
