diff options
author | Jeff Trawick <trawick@apache.org> | 2011-05-06 13:35:49 +0000 |
---|---|---|
committer | Jeff Trawick <trawick@apache.org> | 2011-05-06 13:35:49 +0000 |
commit | fb980e3cce2a8f1fec66093daa9f5ee29cddbd1f (patch) | |
tree | d7962e5262cf8cb62c2ebf14fb06d259158e40ad | |
parent | 6bbd79270343fbe398973a2d60465bebef9c453d (diff) | |
download | httpd-fb980e3cce2a8f1fec66093daa9f5ee29cddbd1f.tar.gz |
Grab r1090634 from trunk:
don't try to shut down child if it wasn't created
(or, fix warning about reference to uninitialized variable
child_exit_event)
Reviewed by: wrowe, covener
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1100211 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | STATUS | 5 | ||||
-rw-r--r-- | server/mpm/winnt/mpm_winnt.c | 10 |
2 files changed, 9 insertions, 6 deletions
@@ -103,11 +103,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK: http://people.apache.org/~trawick/mingw_patch_warnings.txt +1: trawick, wrowe, covener - * WinNT MPM: don't try to shut down child if it wasn't created - Trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1090634 - 2.2.x patch: Trunk patch applies with offset - +1: trawick, wrowe, covener - PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index f0dfc8fb49..797c023275 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -854,13 +854,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; @@ -875,6 +876,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(); } @@ -969,6 +973,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. |