You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by st...@apache.org on 2005/03/01 23:38:04 UTC

svn commit: r155833 - httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c

Author: stoddard
Date: Tue Mar  1 14:38:04 2005
New Revision: 155833

URL: http://svn.apache.org/viewcvs?view=rev&rev=155833
Log:
Win32: Init the args to mpm_service_install(). Prevents nasty things like segfaults

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/viewcvs/httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c?view=diff&r1=155832&r2=155833
==============================================================================
--- httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c (original)
+++ httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c Tue Mar  1 14:38:04 2005
@@ -1283,17 +1283,6 @@
                  "%s: Service is already installed.", service_name);
             exit(APEXIT_INIT);
         }
-        else
-        {
-            /* Install the service */
-            rv = mpm_service_install(process->pool, inst_argc, inst_argv, 0);
-            if (rv != APR_SUCCESS) {
-                exit(rv);
-            }
-            /* Proceed to post_config in order to test the installed configuration */
-            fprintf(stderr,"Testing httpd.conf....\n");
-            fprintf(stderr,"Errors reported here must be corrected before the service can be started.\n");
-        }
     }
     else if (running_as_service)
     {
@@ -1339,24 +1328,39 @@
              "No installed service named \"%s\".", service_name);
         exit(APEXIT_INIT);
     }
-    else if (!strcasecmp(signal_arg, "config")) 
-    {
+
+    /* Track the args actually entered by the user.
+     * These will be used for the -k install parameters, as well as
+     * for the -k start service override arguments.
+     */
+    inst_argv = (const char * const *)mpm_new_argv->elts
+        + mpm_new_argv->nelts - inst_argc;
+
+    /* Now, do service install or reconfigure then proceed to
+     * post_config to test the installed configuration.
+     */
+    if (!strcasecmp(signal_arg, "config")) { /* -k config */
         /* Reconfigure the service */
         rv = mpm_service_install(process->pool, inst_argc, inst_argv, 1);
         if (rv != APR_SUCCESS) {
             exit(rv);
         }
-        /* Proceed to post_config in order to test the installed configuration */
+
         fprintf(stderr,"Testing httpd.conf....\n");
-        fprintf(stderr,"Errors reported here must be corrected before the service can be started.\n");
+        fprintf(stderr,"Errors reported here must be corrected before the "
+                "service can be started.\n");
+    }
+    else if (!strcasecmp(signal_arg, "install")) { /* -k install */
+        /* Install the service */
+        rv = mpm_service_install(process->pool, inst_argc, inst_argv, 0);
+        if (rv != APR_SUCCESS) {
+            exit(rv);
+        }
+
+        fprintf(stderr,"Testing httpd.conf....\n");
+        fprintf(stderr,"Errors reported here must be corrected before the "
+                "service can be started.\n");
     }
-    
-    /* Track the args actually entered by the user.
-     * These will be used for the -k install parameters, as well as
-     * for the -k start service override arguments.
-     */
-    inst_argv = (const char * const *)mpm_new_argv->elts
-        + mpm_new_argv->nelts - inst_argc;
 
     process->argc = mpm_new_argv->nelts; 
     process->argv = (const char * const *) mpm_new_argv->elts;