You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2002/06/14 10:04:14 UTC

cvs commit: httpd-2.0/support/win32 ApacheMonitor.c

wrowe       2002/06/14 01:04:14

  Modified:    support/win32 ApacheMonitor.c
  Log:
    Don't pass args at StartService, there is no point.
  
  PR:9858
  Submitted by:	Mladen Turk <mt...@mappingsoft.com>
  
  Revision  Changes    Path
  1.19      +2 -24     httpd-2.0/support/win32/ApacheMonitor.c
  
  Index: ApacheMonitor.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/support/win32/ApacheMonitor.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- ApacheMonitor.c	19 Apr 2002 19:19:44 -0000	1.18
  +++ ApacheMonitor.c	14 Jun 2002 08:04:14 -0000	1.19
  @@ -667,7 +667,6 @@
       SC_HANDLE schService;
       SC_HANDLE schSCManager;    
       SERVICE_STATUS schSStatus;
  -    LPSTR     *args;
       int       ticks;
   
       if (g_dwOSVersion == OS_VERSION_WIN9X)
  @@ -717,17 +716,6 @@
       }
       else
       {
  -        /* Apache 2.0 uses '-k runservice' as cmdline parameter */
  -        sPos = strstr(szImagePath, "--ntservice");
  -        if (!sPos)
  -        {
  -            sPos = strstr(szImagePath, "-k runservice");
  -            serviceFlag = FALSE;
  -        }
  -        if (sPos)
  -            lstrcpyn(szBuf, szImagePath, sPos - szImagePath);
  -        else
  -            return FALSE;
           schSCManager = OpenSCManager(
               szComputerName,
               NULL,
  @@ -771,16 +759,8 @@
                   case SERVICE_CONTROL_CONTINUE:
                       sprintf(szMsg, g_lpMsg[IDS_MSG_SRVSTART-IDS_MSG_FIRST], szServiceName);
                       addListBoxString(g_hwndStdoutList, szMsg);
  -                    args = (char **)malloc(3 * sizeof(char*));
  -                    args[0] = szBuf;
  -                    if (serviceFlag)
  -                        args[1] = "--ntservice";
  -                    else
  -                    {
  -                        args[1] = "-k";
  -                        args[2] = "runservice";
  -                    }
  -                    if (StartService(schService, serviceFlag ? 2 : 3, args)) 
  +
  +                    if (StartService(schService, 0, NULL)) 
                       {
                           Sleep(1000);
                           while (QueryServiceStatus(schService, &schSStatus)) 
  @@ -800,8 +780,6 @@
                               addListBoxString(g_hwndStdoutList, szMsg);
                           }
                       }
  -                    /* is this OK to do? */
  -                    free(args);
                   break;                
                   case SERVICE_APACHE_RESTART:
                       sprintf(szMsg, g_lpMsg[IDS_MSG_SRVRESTART-IDS_MSG_FIRST], szServiceName);