httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sterling@covalent.net" <sterl...@covalent.net>
Subject [PATCH] allow win32 to run as console
Date Thu, 02 Nov 2000 00:42:05 GMT

I was unable to just run apache as a plain old console app anymore because
it would fall through and set some service properties.  This patch assumes
if you run without a '-k foo' that apache should startup as a
console app.  so now if you just run Apache.exe with no switches, it
starts up.

sterling

Index: mpm_winnt.c
===================================================================
RCS file: /home/cvspublic/apache-2.0/src/modules/mpm/winnt/mpm_winnt.c,v
retrieving revision 1.107
diff -u -r1.107 mpm_winnt.c
--- mpm_winnt.c	2000/10/23 19:04:23	1.107
+++ mpm_winnt.c	2000/11/01 20:41:12
@@ -1824,6 +1824,7 @@
     int fixed_args;
     char *pid;
     apr_getopt_t *opt;
+    int running_as_service = 1;
 
     osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
     GetVersionEx(&osver);
@@ -1931,7 +1932,10 @@
 
     /* Provide a default 'run' -k arg to simplify signal_arg tests */
     if (!signal_arg)
+    {
         signal_arg = "run";
+        running_as_service = 0;
+    }
 
     if (!strcasecmp(signal_arg, "runservice")) 
     {
@@ -1955,7 +1959,7 @@
         }
     }
 
-    if (service_named == SERVICE_UNNAMED) {
+    if (service_named == SERVICE_UNNAMED && running_as_service) {
         service_named = mpm_service_set_name(process->pool, 
                                              DEFAULT_SERVICE_NAME);
     }
@@ -1969,7 +1973,7 @@
             exit(1);
         }
     }
-    else
+    else if (running_as_service)
     {
         if (service_named == APR_SUCCESS) 
         {




Mime
View raw message