httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/mpm/winnt mpm_winnt.c mpm_winnt.h service.c
Date Wed, 09 Aug 2000 14:59:47 GMT
wrowe       00/08/09 07:59:47

  Modified:    src/modules/mpm/winnt mpm_winnt.c mpm_winnt.h service.c
  Log:
    Adjust the WinNT MPM/SCM code for apr_initopt/apr_getopt; mostly just a
    bunch of constness changes.
  
  Revision  Changes    Path
  1.96      +12 -16    apache-2.0/src/modules/mpm/winnt/mpm_winnt.c
  
  Index: mpm_winnt.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/winnt/mpm_winnt.c,v
  retrieving revision 1.95
  retrieving revision 1.96
  diff -u -r1.95 -r1.96
  --- mpm_winnt.c	2000/08/06 06:07:43	1.95
  +++ mpm_winnt.c	2000/08/09 14:59:46	1.96
  @@ -105,7 +105,7 @@
   static HANDLE AcceptExCompPort = NULL;
   
   static int one_process = 0;
  -static char *signal_arg;
  +static char const* signal_arg;
   
   OSVERSIONINFO osver; /* VER_PLATFORM_WIN32_NT */
   
  @@ -1822,10 +1822,11 @@
       char *def_server_root;
       char fnbuf[MAX_PATH];
       char optbuf[3];
  -    char **new_arg;
  +    const char *optarg;
  +    const char **new_arg;
       int fixed_args;
       char *pid;
  -    int opt;
  +    apr_getopt_t *opt;
   
       one_process = !!getenv("ONE_PROCESS");
   
  @@ -1901,15 +1902,15 @@
       fixed_args = mpm_new_argv->nelts;
   
       optbuf[0] = '-'; optbuf[2] = '\0';
  -    while (apr_getopt(process->argc, (char**) process->argv, 
  -                     "n:k:iu" AP_SERVER_BASEARGS, 
  -                     &opt, process->pool) == APR_SUCCESS) {
  -        switch (opt) {
  +    apr_initopt(&opt, process->pool, process->argc, (char**) process->argv);
  +    while (apr_getopt(opt, "n:k:iu" AP_SERVER_BASEARGS, 
  +                      optbuf + 1, &optarg) == APR_SUCCESS) {
  +        switch (optbuf[1]) {
           case 'n':
  -            service_named = mpm_service_set_name(process->pool, apr_optarg);
  +            service_named = mpm_service_set_name(process->pool, optarg);
               break;
           case 'k':
  -            signal_arg = apr_optarg;
  +            signal_arg = optarg;
               break;
           case 'i':
               /* TODO: warn of depreciated syntax, "use -k install instead" */
  @@ -1923,18 +1924,13 @@
               optbuf[1] = (char) opt;
               new_arg = (char**) apr_push_array(mpm_new_argv);
               *new_arg = apr_pstrdup(process->pool, optbuf);
  -            if (apr_optarg) {
  +            if (optarg) {
                   new_arg = (char**) apr_push_array(mpm_new_argv);
  -                *new_arg = apr_optarg;
  +                *new_arg = optarg;
               }
               break;
           }
       }
  -    /* Set optreset and optind to allow apr_getopt to work correctly
  -     * when called from http_main.c
  -     */
  -    apr_optreset = 1;
  -    apr_optind = 1;
       
       /* Track the number of args actually entered by the user */
       inst_argc = mpm_new_argv->nelts - fixed_args;
  
  
  
  1.19      +3 -3      apache-2.0/src/modules/mpm/winnt/mpm_winnt.h
  
  Index: mpm_winnt.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/winnt/mpm_winnt.h,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- mpm_winnt.h	2000/08/02 14:44:51	1.18
  +++ mpm_winnt.h	2000/08/09 14:59:46	1.19
  @@ -88,10 +88,10 @@
   #define SERVICECONFIG "System\\CurrentControlSet\\Services\\%s"
   #define SERVICEPARAMS "System\\CurrentControlSet\\Services\\%s\\Parameters"
   
  -extern char *service_name;
  -extern char *display_name;
  +extern char const* service_name;
  +extern char const* display_name;
   
  -apr_status_t mpm_service_set_name(apr_pool_t *p, char *name);
  +apr_status_t mpm_service_set_name(apr_pool_t *p, const char *name);
   apr_status_t mpm_merge_service_args(apr_pool_t *p, apr_array_header_t *args, 
                                      int fixed_args);
   
  
  
  
  1.22      +8 -8      apache-2.0/src/modules/mpm/winnt/service.c
  
  Index: service.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/winnt/service.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- service.c	2000/08/02 05:27:10	1.21
  +++ service.c	2000/08/09 14:59:46	1.22
  @@ -88,9 +88,9 @@
   #include "mpm_winnt.h"
   #include "apr_strings.h"
   
  -char *service_name = NULL;
  -char *display_name = NULL;
  -char *signal_arg = NULL;
  +char const* service_name = NULL;
  +char const* display_name = NULL;
  +char const* signal_arg = NULL;
       
   static struct
   {
  @@ -446,7 +446,7 @@
       HANDLE hEventSource;
       char errbuf[256];
       char *errmsg = errbuf;
  -    char *errarg[9];
  +    const char *errarg[9];
       DWORD errlen = 0;
       DWORD errres;
       HKEY hk;
  @@ -645,14 +645,14 @@
   }
   
   
  -apr_status_t mpm_service_set_name(apr_pool_t *p, char *name)
  +apr_status_t mpm_service_set_name(apr_pool_t *p, const char *name)
   {
       char *key_name;
       
       service_name = apr_palloc(p, strlen(name) + 1);
  -    apr_collapse_spaces(service_name, name);
  +    apr_collapse_spaces((char*) service_name, name);
       key_name = apr_psprintf(p, SERVICECONFIG, service_name);
  -    if (ap_registry_get_value(p, key_name, "DisplayName", &display_name) == APR_SUCCESS)
  +    if (ap_registry_get_value(p, key_name, "DisplayName", (char**)&display_name) ==
APR_SUCCESS)
           return APR_SUCCESS;
   
       /* Take the given literal name if there is no service entry */
  @@ -1053,7 +1053,7 @@
           
           argc += 1;
           start_argv = apr_palloc(ptemp, argc * sizeof(char**));
  -        start_argv[0] = service_name;
  +        start_argv[0] = (char*) service_name;
           if (argc > 1)
               memcpy(start_argv + 1, argv, (argc - 1) * sizeof(char**));
           
  
  
  

Mime
View raw message