httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1090634 - /httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c
Date Sat, 09 Apr 2011 17:20:23 GMT
Author: trawick
Date: Sat Apr  9 17:20:23 2011
New Revision: 1090634

URL: http://svn.apache.org/viewvc?rev=1090634&view=rev
Log:
don't try to shut down child if it wasn't created
(or, fix warning about reference to uninitialized variable
child_exit_event)

Modified:
    httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c

Modified: httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c?rev=1090634&r1=1090633&r2=1090634&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c (original)
+++ httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c Sat Apr  9 17:20:23 2011
@@ -721,13 +721,14 @@ static int create_process(apr_pool_t *p,
 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, HA
         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.



Mime
View raw message