]> granicus.if.org Git - apache/blobdiff - server/main.c
the mpm_get_child_pid hook is unnecessary, as was the per-MPM MPM_CHILD_PID() macro...
[apache] / server / main.c
index 48a5c234f1dbe9ef4661f908eecec98cb0c7731f..b43daf964097835a262518c7b1c259f19cee41a9 100644 (file)
@@ -52,9 +52,6 @@
  * Most significant main() global data can be found in http_config.c
  */
 
-/* XXX call after module loading based on some cmd-line option/define
- */
-
 static void show_mpm_settings(void)
 {
     int mpm_query_info;
@@ -111,6 +108,8 @@ static void show_compile_settings(void)
      */
     printf("Architecture:   %ld-bit\n", 8 * (long)sizeof(void *));
 
+    show_mpm_settings();
+
     printf("Server compiled with....\n");
 #ifdef BIG_SECURITY_HOLE
     printf(" -D BIG_SECURITY_HOLE\n");
@@ -465,13 +464,12 @@ static void usage(process_rec *process)
 int main(int argc, const char * const argv[])
 {
     char c;
-    int configtestonly = 0;
+    int configtestonly = 0, showcompile = 0;
     const char *confname = SERVER_CONFIG_FILE;
     const char *def_server_root = HTTPD_ROOT;
     const char *temp_error_log = NULL;
     const char *error;
     process_rec *process;
-    apr_pool_t *pglobal;
     apr_pool_t *pconf;
     apr_pool_t *plog; /* Pool of log streams, reset _after_ each read of conf */
     apr_pool_t *ptemp; /* Pool for temporary config stuff, reset often */
@@ -485,7 +483,7 @@ int main(int argc, const char * const argv[])
     AP_MONCONTROL(0); /* turn off profiling of startup */
 
     process = init_process(&argc, &argv);
-    pglobal = process->pool;
+    ap_pglobal = process->pool;
     pconf = process->pconf;
     ap_server_argv0 = process->short_name;
 
@@ -494,15 +492,15 @@ int main(int argc, const char * const argv[])
     apr_pool_abort_set(abort_on_oom, apr_pool_parent_get(process->pool));
 
 #if APR_CHARSET_EBCDIC
-    if (ap_init_ebcdic(pglobal) != APR_SUCCESS) {
+    if (ap_init_ebcdic(ap_pglobal) != APR_SUCCESS) {
         destroy_and_exit_process(process, 1);
     }
 #endif
-    if (ap_expr_init(pglobal) != APR_SUCCESS) {
+    if (ap_expr_init(ap_pglobal) != APR_SUCCESS) {
         destroy_and_exit_process(process, 1);
     }
 
-    apr_pool_create(&pcommands, pglobal);
+    apr_pool_create(&pcommands, ap_pglobal);
     apr_pool_tag(pcommands, "pcommands");
     ap_server_pre_read_config  = apr_array_make(pcommands, 1, sizeof(char *));
     ap_server_post_read_config = apr_array_make(pcommands, 1, sizeof(char *));
@@ -601,8 +599,14 @@ int main(int argc, const char * const argv[])
             destroy_and_exit_process(process, 0);
 
         case 'V':
-            show_compile_settings();
-            destroy_and_exit_process(process, 0);
+            if (strcmp(ap_show_mpm(), "")) { /* MPM built-in? */
+                show_compile_settings();
+                destroy_and_exit_process(process, 0);
+            }
+            else {
+                showcompile = 1;
+            }
+            break;
 
         case 'l':
             ap_show_modules();
@@ -639,7 +643,7 @@ int main(int argc, const char * const argv[])
         usage(process);
     }
 
-    apr_pool_create(&plog, pglobal);
+    apr_pool_create(&plog, ap_pglobal);
     apr_pool_tag(plog, "plog");
     apr_pool_create(&ptemp, pconf);
     apr_pool_tag(ptemp, "ptemp");
@@ -683,6 +687,10 @@ int main(int argc, const char * const argv[])
             ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, "Syntax OK");
             destroy_and_exit_process(process, 0);
         }
+        else if (showcompile) { /* deferred due to dynamically loaded MPM */
+            show_compile_settings();
+            destroy_and_exit_process(process, 0);
+        }
     }
 
     signal_server = APR_RETRIEVE_OPTIONAL_FN(ap_signal_server);