summaryrefslogtreecommitdiff
path: root/server/mpm
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2011-03-02 23:17:22 +0000
committerJeff Trawick <trawick@apache.org>2011-03-02 23:17:22 +0000
commit60221bdd7660ba3cc60ef89569690bee371bab10 (patch)
treea64441a10430a49b33c72535efeedda1cd2f8c32 /server/mpm
parent4618019d697f18faeda96f751e9d89768b7329f6 (diff)
downloadhttpd-60221bdd7660ba3cc60ef89569690bee371bab10.tar.gz
prefork in ONE_PROCESS mode:
child_main() called clean_child_exit() in almost all paths, and returned to the caller in one infrequent path; just call clean_child_exit() always git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1076454 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/mpm')
-rw-r--r--server/mpm/prefork/prefork.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c
index 252d656093..7bac60d66b 100644
--- a/server/mpm/prefork/prefork.c
+++ b/server/mpm/prefork/prefork.c
@@ -585,16 +585,12 @@ static void child_main(int child_num_arg)
/* check for termination first so we don't sleep for a while in
* poll if already signalled
*/
- if (one_process && shutdown_pending) {
- SAFE_ACCEPT(accept_mutex_off());
- return;
- }
- else if (die_now) {
- /* In graceful stop/restart; drop the mutex
- * and terminate the child. */
+ if (die_now /* in graceful stop/restart */
+ || (one_process && shutdown_pending)) {
SAFE_ACCEPT(accept_mutex_off());
clean_child_exit(0);
}
+
/* timeout == 10 seconds to avoid a hang at graceful restart/stop
* caused by the closing of sockets by the signal handler
*/
@@ -710,7 +706,7 @@ static int make_child(server_rec *s, int slot)
apr_signal(SIGTERM, sig_term);
ap_scoreboard_image->parent[slot].pid = getpid();
child_main(slot);
- return 0;
+ /* NOTREACHED */
}
(void) ap_update_child_status_from_indexes(slot, 0, SERVER_STARTING,
@@ -934,6 +930,7 @@ static int prefork_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
if (one_process) {
AP_MONCONTROL(1);
make_child(ap_server_conf, 0);
+ /* NOTREACHED */
}
else {
if (ap_daemons_max_free < ap_daemons_min_free + 1) /* Don't thrash... */