httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stodd...@locus.apache.org
Subject cvs commit: apache-1.3/src/main http_log.c util_script.c
Date Fri, 03 Mar 2000 05:59:12 GMT
stoddard    00/03/02 21:59:12

  Modified:    src/main http_log.c util_script.c
  Log:
  Win32: Use the COMSPEC envar to set the shell name.
  
  Submitted by:	Bill Rowe <wrowe@Ind.com>
  Reviewed by:	Bill Stoddard <stoddard@apache.org>
  
  Revision  Changes    Path
  1.84      +14 -2     apache-1.3/src/main/http_log.c
  
  Index: http_log.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/main/http_log.c,v
  retrieving revision 1.83
  retrieving revision 1.84
  diff -u -r1.83 -r1.84
  --- http_log.c	2000/02/02 20:43:49	1.83
  +++ http_log.c	2000/03/03 05:59:11	1.84
  @@ -162,6 +162,9 @@
        * be common for other foo-loggers to want this sort of thing...
        */
       int child_pid = 0;
  +#if defined(WIN32)
  +    char *shellcmd;
  +#endif
   
       ap_cleanup_for_exec();
   #ifdef SIGHUP
  @@ -172,7 +175,10 @@
       child_pid = spawnlp(P_NOWAIT, SHELL_PATH, (char *)cmd);
       return(child_pid);
   #elif defined(WIN32)
  -    child_pid = spawnl(_P_NOWAIT, SHELL_PATH, SHELL_PATH, "/c", (char *)cmd, NULL);
  +    shellcmd = getenv("COMSPEC");
  +    if (!shellcmd)
  +        shellcmd = SHELL_PATH;
  +    child_pid = spawnl(_P_NOWAIT, shellcmd, shellcmd, "/c", (char *)cmd, NULL);
       return(child_pid);
   #elif defined(OS2)
       /* For OS/2 we need to use a '/' and spawn the child rather than exec as
  @@ -735,6 +741,9 @@
        * be common for other foo-loggers to want this sort of thing...
        */
       int child_pid = 1;
  +#if defined(WIN32)
  +    char *shellcmd;
  +#endif
   
       ap_cleanup_for_exec();
   #ifdef SIGHUP
  @@ -744,7 +753,10 @@
       child_pid = spawnlp(P_NOWAIT, SHELL_PATH, (char *)cmd);
       return(child_pid);
   #elif defined(WIN32)
  -    child_pid = spawnl(_P_NOWAIT, SHELL_PATH, SHELL_PATH, "/c", (char *)cmd, NULL);
  +    shellcmd = getenv("COMSPEC");
  +    if (!shellcmd)
  +        shellcmd = SHELL_PATH;
  +    child_pid = spawnl(_P_NOWAIT, shellcmd, shellcmd, "/c", (char *)cmd, NULL);
       return(child_pid);
   #elif defined(OS2)
       /* For OS/2 we need to use a '/' and spawn the child rather than exec as
  
  
  
  1.151     +5 -15     apache-1.3/src/main/util_script.c
  
  Index: util_script.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/main/util_script.c,v
  retrieving revision 1.150
  retrieving revision 1.151
  diff -u -r1.150 -r1.151
  --- util_script.c	2000/02/27 06:07:10	1.150
  +++ util_script.c	2000/03/03 05:59:11	1.151
  @@ -988,21 +988,11 @@
                   pCommand = ap_pstrcat(r->pool, quoted_filename, " ", arguments, NULL);
               }
   
  -         } else {
  -
  -            char *shell_cmd = "CMD.EXE /C ";
  -            OSVERSIONINFO osver;
  -            osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  -         
  -            /*
  -             * Use CMD.EXE for NT, COMMAND.COM for WIN95
  -             */
  -            if (GetVersionEx(&osver)) {
  -                if (osver.dwPlatformId != VER_PLATFORM_WIN32_NT) {
  -                    shell_cmd = "COMMAND.COM /C ";
  -                }
  -            }       
  -            pCommand = ap_pstrcat(r->pool, shell_cmd, argv0, NULL);
  +        } else {
  +            char *shellcmd = getenv("COMSPEC");
  +            if (!shellcmd)
  +                shellcmd = SHELL_PATH;
  +            pCommand = ap_pstrcat(r->pool, shellcmd, " /C ", argv0, NULL);
           }
   
           /*
  
  
  

Mime
View raw message