httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grega...@apache.org
Subject cvs commit: apache-1.3/src/support rotatelogs.c
Date Wed, 26 Dec 2001 17:14:06 GMT
gregames    01/12/26 09:14:06

  Modified:    src/os/tpf os.c
               src/support rotatelogs.c
  Log:
  get rotatelogs to function properly on TPF
  Submitted by:	David McCreedy
  Reviewed by:	Greg Ames
  
  Revision  Changes    Path
  1.13      +13 -3     apache-1.3/src/os/tpf/os.c
  
  Index: os.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/os/tpf/os.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- os.c	2001/06/22 12:43:55	1.12
  +++ os.c	2001/12/26 17:14:06	1.13
  @@ -203,7 +203,10 @@
      array_header             *env_arr = ap_table_elts ((array_header *) cld->subprocess_env);
      table_entry              *elts = (table_entry *) env_arr->elts;
   #ifdef TPF_FORK_EXTENDED
  -   char                     *args[2];
  +#define WHITE " \t\n"
  +#define MAXARGC 49
  +   char                     *arguments;
  +   char                     *args[MAXARGC + 1];
      char                     **envp = NULL;
      pool                     *subpool = NULL;
   
  @@ -267,8 +270,15 @@
      fork_input.parm_data = NULL;
   
   #ifdef TPF_FORK_EXTENDED
  -   args[0] = cld->filename;
  -   args[1] = NULL;
  +   /* use a copy of cld->filename because strtok is destructive */
  +   arguments = ap_pstrdup(p, cld->filename);
  +   args[0] = strtok(arguments, WHITE);
  +   args[MAXARGC + 1] = NULL;
  +
  +   for (i = 0; i < MAXARGC && args[i] ; i++) {
  +       args[i + 1] = strtok(NULL, WHITE);
  +   }
  +
      if ((pid = tpf_fork(&fork_input,
                          (const char **)args,
                          (const char **)envp)) < 0) {
  
  
  
  1.17      +6 -0      apache-1.3/src/support/rotatelogs.c
  
  Index: rotatelogs.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/support/rotatelogs.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- rotatelogs.c	2001/03/13 20:05:05	1.16
  +++ rotatelogs.c	2001/12/26 17:14:06	1.17
  @@ -28,6 +28,12 @@
       time_t now;
       char *szLogRoot;
   
  +#ifdef TPF
  +    /* set up signal handling to avoid default OPR-I007777 dump */
  +    signal(SIGPIPE, exit);
  +    signal(SIGTERM, exit);
  +#endif
  +
       if (argc < 3) {
           fprintf(stderr,
                   "Usage: %s <logfile> <rotation time in seconds> "
  
  
  

Mime
View raw message