httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yla...@apache.org
Subject svn commit: r1733173 - in /httpd/httpd/trunk/server/mpm: event/event.c mpmt_os2/mpmt_os2.c prefork/prefork.c winnt/mpm_winnt.c worker/worker.c
Date Tue, 01 Mar 2016 22:29:50 GMT
Author: ylavic
Date: Tue Mar  1 22:29:50 2016
New Revision: 1733173

URL: http://svn.apache.org/viewvc?rev=1733173&view=rev
Log:
mpms: follow up to r1629925: more error reports.
Failing to setup (or no) listeners is also an error.

Modified:
    httpd/httpd/trunk/server/mpm/event/event.c
    httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2.c
    httpd/httpd/trunk/server/mpm/prefork/prefork.c
    httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c
    httpd/httpd/trunk/server/mpm/worker/worker.c

Modified: httpd/httpd/trunk/server/mpm/event/event.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=1733173&r1=1733172&r2=1733173&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/event/event.c (original)
+++ httpd/httpd/trunk/server/mpm/event/event.c Tue Mar  1 22:29:50 2016
@@ -3345,7 +3345,7 @@ static int event_open_logs(apr_pool_t *
         ap_log_error(APLOG_MARK, APLOG_ALERT | level_flags, 0,
                      (startup ? NULL : s), APLOGNO(03272)
                      "no listening sockets available, shutting down");
-        return DONE;
+        return !OK;
     }
 
     if (one_process) {

Modified: httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2.c?rev=1733173&r1=1733172&r2=1733173&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2.c (original)
+++ httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2.c Tue Mar  1 22:29:50 2016
@@ -102,7 +102,7 @@ typedef struct {
     listen_socket_t listeners[1];
 } parent_info_t;
 
-static char master_main();
+static int master_main();
 static void spawn_child(int slot);
 void ap_mpm_child_main(apr_pool_t *pconf);
 static void set_signals();
@@ -157,7 +157,7 @@ static int mpmt_os2_run(apr_pool_t *_pco
     }
     else {
         /* Parent process */
-        char restart;
+        int rc;
         is_parent_process = TRUE;
 
         if (ap_setup_listeners(ap_server_conf) < 1) {
@@ -168,15 +168,16 @@ static int mpmt_os2_run(apr_pool_t *_pco
 
         ap_log_pid(pconf, ap_pid_fname);
 
-        restart = master_main();
+        rc = master_main();
         ++ap_my_generation;
         ap_scoreboard_image->global->running_generation = ap_my_generation;
 
-        if (!restart) {
+        if (rc != OK) {
             ap_remove_pid(pconf, ap_pid_fname);
             ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf, APLOGNO(00201)
-                         "caught SIGTERM, shutting down");
-            return DONE;
+                         "caught %s, shutting down",
+                         (rc == DONE) ? "SIGTERM" : "error");
+            return rc;
         }
     }  /* Parent process */
 
@@ -188,7 +189,7 @@ static int mpmt_os2_run(apr_pool_t *_pco
 /* Main processing of the parent process
  * returns TRUE if restarting
  */
-static char master_main()
+static int master_main()
 {
     server_rec *s = ap_server_conf;
     ap_listen_rec *lr;
@@ -203,7 +204,7 @@ static char master_main()
     if (ap_setup_listeners(ap_server_conf) < 1) {
         ap_log_error(APLOG_MARK, APLOG_ALERT, 0, s, APLOGNO(00202)
                      "no listening sockets available, shutting down");
-        return FALSE;
+        return !OK;
     }
 
     /* Allocate a shared memory block for the array of listeners */
@@ -219,7 +220,7 @@ static char master_main()
     if (rc) {
         ap_log_error(APLOG_MARK, APLOG_ALERT, APR_FROM_OS_ERROR(rc), s, APLOGNO(00203)
                      "failure allocating shared memory, shutting down");
-        return FALSE;
+        return !OK;
     }
 
     /* Store the listener sockets in the shared memory area for our children to see */
@@ -236,7 +237,7 @@ static char master_main()
     if (rc) {
         ap_log_error(APLOG_MARK, APLOG_ALERT, APR_FROM_OS_ERROR(rc), s, APLOGNO(00204)
                      "failure creating accept mutex, shutting down");
-        return FALSE;
+        return !OK;
     }
 
     parent_info->accept_mutex = ap_mpm_accept_mutex;
@@ -251,7 +252,7 @@ static char master_main()
         if (rc) {
             ap_log_error(APLOG_MARK, APLOG_ERR, APR_FROM_OS_ERROR(rc), ap_server_conf, APLOGNO(00205)
                          "unable to allocate shared memory for scoreboard , exiting");
-            return FALSE;
+            return !OK;
         }
 
         ap_init_scoreboard(sb_mem);
@@ -266,7 +267,7 @@ static char master_main()
     if (one_process) {
         ap_scoreboard_image->parent[0].pid = getpid();
         ap_mpm_child_main(pconf);
-        return FALSE;
+        return DONE;
     }
 
     while (!restart_pending && !shutdown_pending) {
@@ -318,7 +319,7 @@ static char master_main()
     }
 
     DosFreeMem(parent_info);
-    return restart_pending;
+    return restart_pending ? OK : DONE;
 }
 
 

Modified: httpd/httpd/trunk/server/mpm/prefork/prefork.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/prefork/prefork.c?rev=1733173&r1=1733172&r2=1733173&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/prefork/prefork.c (original)
+++ httpd/httpd/trunk/server/mpm/prefork/prefork.c Tue Mar  1 22:29:50 2016
@@ -1308,7 +1308,7 @@ static int prefork_open_logs(apr_pool_t
         ap_log_error(APLOG_MARK, APLOG_ALERT | level_flags, 0,
                      (startup ? NULL : s), APLOGNO(03279)
                      "no listening sockets available, shutting down");
-        return DONE;
+        return !OK;
     }
 
     if (one_process) {

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=1733173&r1=1733172&r2=1733173&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c (original)
+++ httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c Tue Mar  1 22:29:50 2016
@@ -1653,7 +1653,7 @@ static int winnt_open_logs(apr_pool_t *p
     if (ap_setup_listeners(s) < 1) {
         ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_STARTUP, 0,
                      NULL, APLOGNO(00451) "no listening sockets available, shutting down");
-        return DONE;
+        return !OK;
     }
 
     return OK;

Modified: httpd/httpd/trunk/server/mpm/worker/worker.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/worker/worker.c?rev=1733173&r1=1733172&r2=1733173&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/worker/worker.c (original)
+++ httpd/httpd/trunk/server/mpm/worker/worker.c Tue Mar  1 22:29:50 2016
@@ -2033,7 +2033,7 @@ static int worker_open_logs(apr_pool_t *
         ap_log_error(APLOG_MARK, APLOG_ALERT | level_flags, 0,
                      (startup ? NULL : s), APLOGNO(03290)
                      "no listening sockets available, shutting down");
-        return DONE;
+        return !OK;
     }
 
     if (one_process) {



Mime
View raw message