summaryrefslogtreecommitdiffstats
path: root/server/mpm/winnt
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2011-04-09 19:20:23 +0200
committerJeff Trawick <trawick@apache.org>2011-04-09 19:20:23 +0200
commitebab39cd9824ab4636a9a8c343c3e78688ad202a (patch)
tree4895db8b1b978fac0fef8d87556161f980c278d2 /server/mpm/winnt
parentWinNT MPM: Improve robustness under heavy load. (diff)
downloadapache2-ebab39cd9824ab4636a9a8c343c3e78688ad202a.tar.xz
apache2-ebab39cd9824ab4636a9a8c343c3e78688ad202a.zip
don't try to shut down child if it wasn't created
(or, fix warning about reference to uninitialized variable child_exit_event) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1090634 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/mpm/winnt')
-rw-r--r--server/mpm/winnt/mpm_winnt.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c
index 2556d80bb4..d727d00a86 100644
--- a/server/mpm/winnt/mpm_winnt.c
+++ b/server/mpm/winnt/mpm_winnt.c
@@ -721,13 +721,14 @@ static int create_process(apr_pool_t *p, HANDLE *child_proc, HANDLE *child_exit_
static int master_main(server_rec *s, HANDLE shutdown_event, HANDLE restart_event)
{
int rv, cld;
+ int child_created;
int restart_pending;
int shutdown_pending;
HANDLE child_exit_event;
HANDLE event_handles[NUM_WAIT_HANDLES];
DWORD child_pid;
- restart_pending = shutdown_pending = 0;
+ child_created = restart_pending = shutdown_pending = 0;
event_handles[SHUTDOWN_HANDLE] = shutdown_event;
event_handles[RESTART_HANDLE] = restart_event;
@@ -742,6 +743,9 @@ static int master_main(server_rec *s, HANDLE shutdown_event, HANDLE restart_even
shutdown_pending = 1;
goto die_now;
}
+
+ child_created = 1;
+
if (!strcasecmp(signal_arg, "runservice")) {
mpm_service_started();
}
@@ -836,6 +840,10 @@ die_now:
int timeout = 30000; /* Timeout is milliseconds */
winnt_mpm_state = AP_MPMQ_STOPPING;
+ if (!child_created) {
+ return 0; /* Tell the caller we do not want to restart */
+ }
+
/* This shutdown is only marginally graceful. We will give the
* child a bit of time to exit gracefully. If the time expires,
* the child will be wacked.