httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/mpm/spmt_os2 mpm.h spmt_os2.c
Date Mon, 10 Jul 2000 18:21:24 GMT
rbb         00/07/10 11:21:24

  Modified:    src/include mpm_common.h
               src/main mpm_common.c
               src/modules/mpm/beos beos.c mpm.h
               src/modules/mpm/dexter dexter.c mpm.h
               src/modules/mpm/mpmt mpm.h mpmt.c
               src/modules/mpm/mpmt_beos mpm.h mpmt_beos.c
               src/modules/mpm/mpmt_pthread mpm.h mpmt_pthread.c
               src/modules/mpm/prefork mpm.h prefork.c
               src/modules/mpm/spmt_os2 mpm.h spmt_os2.c
  Log:
  Move process_child_status to mpm_common.c.  This requires re-naming it
  to ap_process_child_status and opening up ap_coredump_dir.  I have
  modified all of the MPMs that I saw using this function to work with this
  patch.  Sorry if I broke anybody.
  
  Revision  Changes    Path
  1.4       +1 -0      apache-2.0/src/include/mpm_common.h
  
  Index: mpm_common.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/include/mpm_common.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- mpm_common.h	2000/06/21 13:15:26	1.3
  +++ mpm_common.h	2000/07/10 18:21:19	1.4
  @@ -76,6 +76,7 @@
   
   void ap_reclaim_child_processes(int terminate);
   void ap_wait_or_timeout(ap_wait_t *status, ap_proc_t *ret, ap_pool_t *p);
  +void ap_process_child_status(ap_proc_t *pid, ap_wait_t status);
   
   #define AP_MPM_HARD_LIMITS_FILE "src/" APACHE_MPM_DIR "/mpm_default.h"
   
  
  
  
  1.20      +52 -0     apache-2.0/src/main/mpm_common.c
  
  Index: mpm_common.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/mpm_common.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- mpm_common.c	2000/07/09 23:12:44	1.19
  +++ mpm_common.c	2000/07/10 18:21:19	1.20
  @@ -224,4 +224,56 @@
       return;
   }
   
  +void ap_process_child_status(ap_proc_t *pid, ap_wait_t status)
  +{
  +    /* Child died... if it died due to a fatal error,
  +        * we should simply bail out.
  +        */
  +    if ((WIFEXITED(status)) &&
  +        WEXITSTATUS(status) == APEXIT_CHILDFATAL) {
  +        ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, 0, ap_server_conf,
  +                        "Child %ld returned a Fatal error... \n"
  +                        "Apache is exiting!",
  +                        (long)pid->pid);
  +        exit(APEXIT_CHILDFATAL);
  +    }
  +    if (WIFSIGNALED(status)) {
  +        switch (WTERMSIG(status)) {
  +        case SIGTERM:
  +        case SIGHUP:
  +        case SIGUSR1:
  +        case SIGKILL:
  +            break;
  +        default:
  +#ifdef SYS_SIGLIST
  +#ifdef WCOREDUMP
  +            if (WCOREDUMP(status)) {
  +                ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  +                             0, ap_server_conf,
  +                             "child pid %ld exit signal %s (%d), "
  +                             "possible coredump in %s",
  +                             (long)pid->pid, (WTERMSIG(status) >= NumSIG) ? "" :
  +                             SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status),
  +                             ap_coredump_dir);
  +            }
  +            else {
  +#endif
  +                ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  +                             0, ap_server_conf,
  +                             "child pid %ld exit signal %s (%d)",
  +                             (long)pid->pid,
  +                             SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status));
  +#ifdef WCOREDUMP
  +            }
  +#endif
  +#else
  +            ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  +                         0, ap_server_conf,
  +                         "child pid %ld exit signal %d",
  +                         (long)pid->pid, WTERMSIG(status));
  +#endif
  +        }
  +    }
  +}
  +
   
  
  
  
  1.7       +3 -54     apache-2.0/src/modules/mpm/beos/beos.c
  
  Index: beos.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/beos/beos.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- beos.c	2000/07/05 19:39:29	1.6
  +++ beos.c	2000/07/10 18:21:19	1.7
  @@ -1,4 +1,4 @@
  -/* ====================================================================
  +ap_/* ====================================================================
    * The Apache Software License, Version 1.1
    *
    * Copyright (c) 2000 The Apache Software Foundation.  All rights
  @@ -126,7 +126,7 @@
    */
   int ap_max_child_assigned = -1;
   int ap_max_threads_limit = -1;
  -static char ap_coredump_dir[MAX_STRING_LEN];
  +char ap_coredump_dir[MAX_STRING_LEN];
   static port_id port_of_death;
   
   /* shared http_main globals... */
  @@ -289,57 +289,6 @@
   	    ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGWINCH)");
   }
   
  -static void process_child_status(int pid, ap_wait_t status)
  -{
  -    /* Child died... if it died due to a fatal error,
  -	* we should simply bail out.
  -	*/
  -    if ((WIFEXITED(status)) &&
  -	WEXITSTATUS(status) == APEXIT_CHILDFATAL) {
  -	ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, 0, ap_server_conf,
  -			"Child %d returned a Fatal error... \n"
  -			"Apache is exiting!",
  -			pid);
  -	exit(APEXIT_CHILDFATAL);
  -    }
  -    if (WIFSIGNALED(status)) {
  -	switch (WTERMSIG(status)) {
  -	case SIGTERM:
  -	case SIGHUP:
  -	case SIGUSR1:
  -	case SIGKILL:
  -	    break;
  -	default:
  -#ifdef SYS_SIGLIST
  -#ifdef WCOREDUMP
  -	    if (WCOREDUMP(status)) {
  -		ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  -			     0, ap_server_conf,
  -			     "child pid %d exit signal %s (%d), "
  -			     "possible coredump in %s",
  -			     pid, (WTERMSIG(status) >= NumSIG) ? "" : 
  -			     SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status),
  -			     ap_coredump_dir);
  -	    }
  -	    else {
  -#endif
  -		ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  -			     0, ap_server_conf,
  -			     "child pid %d exit signal %s (%d)", pid,
  -			     SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status));
  -#ifdef WCOREDUMP
  -	    }
  -#endif
  -#else
  -	    ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  -			 0, ap_server_conf,
  -			 "child pid %d exit signal %d",
  -			 pid, WTERMSIG(status));
  -#endif
  -	}
  -    }
  -}
  -
   static int setup_listeners(server_rec *s)
   {
       ap_listen_rec *lr;
  @@ -664,7 +613,7 @@
           ap_wait_or_timeout(&status, &pid, pconf);
            
           if (pid.pid >= 0) {
  -            process_child_status(pid.pid, status);
  +            ap_process_child_status(pid.pid, status);
               /* non-fatal death... note that it's gone in the scoreboard. */
               child_slot = -1;
               for (i = 0; i < ap_max_child_assigned; ++i) {
  
  
  
  1.2       +1 -1      apache-2.0/src/modules/mpm/beos/mpm.h
  
  Index: mpm.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/beos/mpm.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mpm.h	2000/06/20 14:30:00	1.1
  +++ mpm.h	2000/07/10 18:21:19	1.2
  @@ -74,6 +74,6 @@
   
   extern ap_ctable ap_child_table[HARD_SERVER_LIMIT];
   extern server_rec *ap_server_conf;
  -
  +extern char ap_coredump_dir[MAX_STRING_LEN];
   
   #endif /* APACHE_MPM_BEOS_H */
  
  
  
  1.110     +2 -54     apache-2.0/src/modules/mpm/dexter/dexter.c
  
  Index: dexter.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/dexter/dexter.c,v
  retrieving revision 1.109
  retrieving revision 1.110
  diff -u -r1.109 -r1.110
  --- dexter.c	2000/07/05 19:39:43	1.109
  +++ dexter.c	2000/07/10 18:21:20	1.110
  @@ -118,7 +118,7 @@
    */
   int ap_max_daemons_limit = -1;
   
  -static char ap_coredump_dir[MAX_STRING_LEN];
  +char ap_coredump_dir[MAX_STRING_LEN];
   
   static ap_file_t *pipe_of_death_in = NULL;
   static ap_file_t *pipe_of_death_out = NULL;
  @@ -376,58 +376,6 @@
   #endif
   }
   
  -static void process_child_status(ap_proc_t *pid, ap_wait_t status)
  -{
  -    /* Child died... if it died due to a fatal error,
  -	* we should simply bail out.
  -	*/
  -    if ((WIFEXITED(status)) &&
  -	WEXITSTATUS(status) == APEXIT_CHILDFATAL) {
  -	ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, 0, ap_server_conf,
  -			"Child %ld returned a Fatal error... \n"
  -			"Apache is exiting!",
  -			(long)pid->pid);
  -	exit(APEXIT_CHILDFATAL);
  -    }
  -    if (WIFSIGNALED(status)) {
  -	switch (WTERMSIG(status)) {
  -	case SIGTERM:
  -	case SIGHUP:
  -	case SIGUSR1:
  -	case SIGKILL:
  -	    break;
  -	default:
  -#ifdef SYS_SIGLIST
  -#ifdef WCOREDUMP
  -	    if (WCOREDUMP(status)) {
  -		ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0,
  -			     ap_server_conf,
  -			     "child pid %ld exit signal %s (%d), "
  -			     "possible coredump in %s",
  -			     (long)pid->pid, (WTERMSIG(status) >= NumSIG) ? "" :
  -			     SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status),
  -			     ap_coredump_dir);
  -	    }
  -	    else {
  -#endif
  -		ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0,
  -			     ap_server_conf,
  -			     "child pid %ld exit signal %s (%d)", 
  -                             (long)pid->pid,
  -			     SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status));
  -#ifdef WCOREDUMP
  -	    }
  -#endif
  -#else
  -	    ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0,
  -			 ap_server_conf,
  -			 "child pid %ld exit signal %d",
  -			 (long)pid->pid, WTERMSIG(status));
  -#endif
  -	}
  -    }
  -}
  -
   static int setup_listeners(server_rec *s)
   {
       ap_listen_rec *lr;
  @@ -988,7 +936,7 @@
           ap_wait_or_timeout(&status, &pid, pconf);
           
           if (pid.pid != -1) {
  -            process_child_status(&pid, status);
  +            ap_process_child_status(&pid, status);
               /* non-fatal death... note that it's gone in the child table and
                * clean out the status table. */
               child_slot = -1;
  
  
  
  1.3       +2 -0      apache-2.0/src/modules/mpm/dexter/mpm.h
  
  Index: mpm.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/dexter/mpm.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- mpm.h	2000/06/06 21:45:14	1.2
  +++ mpm.h	2000/07/10 18:21:20	1.3
  @@ -78,4 +78,6 @@
   extern int ap_max_daemons_limit;
   extern ap_ctable ap_child_table[HARD_SERVER_LIMIT];
   extern server_rec *ap_server_conf;
  +extern char ap_coredump_dir[MAX_STRING_LEN];
  +
   #endif /* APACHE_MPM_DEXTER_H */
  
  
  
  1.2       +1 -0      apache-2.0/src/modules/mpm/mpmt/mpm.h
  
  Index: mpm.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt/mpm.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mpm.h	2000/07/07 17:35:43	1.1
  +++ mpm.h	2000/07/10 18:21:20	1.2
  @@ -90,5 +90,6 @@
   /* variables needed for ANY mpmt MPM */
   extern server_rec *ap_server_conf;
   extern int ap_max_daemons_limit;
  +extern char ap_coredump_dir[MAX_STRING_LEN];
   
   #endif /* APACHE_MPM_MPMT_PTHREAD_H */
  
  
  
  1.7       +2 -54     apache-2.0/src/modules/mpm/mpmt/mpmt.c
  
  Index: mpmt.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt/mpmt.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- mpmt.c	2000/07/09 18:41:53	1.6
  +++ mpmt.c	2000/07/10 18:21:21	1.7
  @@ -133,7 +133,7 @@
    */
   int ap_max_daemons_limit = -1;
   
  -static char ap_coredump_dir[MAX_STRING_LEN];
  +char ap_coredump_dir[MAX_STRING_LEN];
   
   static ap_file_t *pipe_of_death_in = NULL;
   static ap_file_t *pipe_of_death_out = NULL;
  @@ -404,58 +404,6 @@
   #endif
   }
   
  -static void process_child_status(ap_proc_t *pid, ap_wait_t status)
  -{
  -    /* Child died... if it died due to a fatal error,
  -        * we should simply bail out.
  -        */
  -    if ((WIFEXITED(status)) &&
  -        WEXITSTATUS(status) == APEXIT_CHILDFATAL) {
  -        ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, 0, ap_server_conf,
  -                        "Child %ld returned a Fatal error... \n"
  -                        "Apache is exiting!",
  -                        (long)pid->pid);
  -        exit(APEXIT_CHILDFATAL);
  -    }
  -    if (WIFSIGNALED(status)) {
  -        switch (WTERMSIG(status)) {
  -        case SIGTERM:
  -        case SIGHUP:
  -        case SIGUSR1:
  -        case SIGKILL:
  -            break;
  -        default:
  -#ifdef SYS_SIGLIST
  -#ifdef WCOREDUMP
  -            if (WCOREDUMP(status)) {
  -                ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  -                             0, ap_server_conf,
  -                             "child pid %ld exit signal %s (%d), "
  -                             "possible coredump in %s",
  -                             (long)pid->pid, (WTERMSIG(status) >= NumSIG) ? "" :
  -                             SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status),
  -                             ap_coredump_dir);
  -            }
  -            else {
  -#endif
  -                ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  -                             0, ap_server_conf,
  -                             "child pid %ld exit signal %s (%d)", 
  -                             (long)pid->pid,
  -                             SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status));
  -#ifdef WCOREDUMP
  -            }
  -#endif
  -#else
  -            ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  -                         0, ap_server_conf,
  -                         "child pid %ld exit signal %d",
  -                         (long)pid->pid, WTERMSIG(status));
  -#endif
  -        }
  -    }
  -}
  -
   static int setup_listeners(server_rec *s)
   {
       ap_listen_rec *lr;
  @@ -1388,7 +1336,7 @@
           ap_wait_or_timeout(&status, &pid, pconf);
           
           if (pid.pid != -1) {
  -            process_child_status(&pid, status);
  +            ap_process_child_status(&pid, status);
   #ifdef DEXTER
           /* TODO:  scoreboard stuff -- rbb */
               /* non-fatal death... note that it's gone in the child table and
  
  
  
  1.2       +1 -0      apache-2.0/src/modules/mpm/mpmt_beos/mpm.h
  
  Index: mpm.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_beos/mpm.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mpm.h	2000/06/03 16:58:08	1.1
  +++ mpm.h	2000/07/10 18:21:21	1.2
  @@ -74,5 +74,6 @@
   extern int ap_max_daemons_limit;
   extern ap_ctable ap_child_table[HARD_SERVER_LIMIT];
   extern server_rec *ap_server_conf;
  +extern char ap_coredump_dir[MAX_STRING_LEN];
   
   #endif /* APACHE_MPM_MPMT_BEOS_H */
  
  
  
  1.38      +2 -53     apache-2.0/src/modules/mpm/mpmt_beos/mpmt_beos.c
  
  Index: mpmt_beos.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_beos/mpmt_beos.c,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- mpmt_beos.c	2000/07/05 19:39:53	1.37
  +++ mpmt_beos.c	2000/07/10 18:21:21	1.38
  @@ -125,7 +125,7 @@
    * value to optimize routines that have to scan the entire scoreboard.
    */
   int ap_max_daemons_limit = -1;
  -static char ap_coredump_dir[MAX_STRING_LEN];
  +char ap_coredump_dir[MAX_STRING_LEN];
   port_id port_of_death;
   
   /* shared http_main globals... */
  @@ -277,57 +277,6 @@
   	    ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGWINCH)");
   }
   
  -static void process_child_status(int pid, ap_wait_t status)
  -{
  -    /* Child died... if it died due to a fatal error,
  -	* we should simply bail out.
  -	*/
  -    if ((WIFEXITED(status)) &&
  -	WEXITSTATUS(status) == APEXIT_CHILDFATAL) {
  -	ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, errno, ap_server_conf,
  -			"Child %d returned a Fatal error... \n"
  -			"Apache is exiting!",
  -			pid);
  -	exit(APEXIT_CHILDFATAL);
  -    }
  -    if (WIFSIGNALED(status)) {
  -	switch (WTERMSIG(status)) {
  -	case SIGTERM:
  -	case SIGHUP:
  -	case SIGUSR1:
  -	case SIGKILL:
  -	    break;
  -	default:
  -#ifdef SYS_SIGLIST
  -#ifdef WCOREDUMP
  -	    if (WCOREDUMP(status)) {
  -		ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  -			     errno, ap_server_conf,
  -			     "child pid %d exit signal %s (%d), "
  -			     "possible coredump in %s",
  -			     pid, (WTERMSIG(status) >= NumSIG) ? "" : 
  -			     SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status),
  -			     ap_coredump_dir);
  -	    }
  -	    else {
  -#endif
  -		ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  -			     errno, ap_server_conf,
  -			     "child pid %d exit signal %s (%d)", pid,
  -			     SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status));
  -#ifdef WCOREDUMP
  -	    }
  -#endif
  -#else
  -	    ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  -			 errno, ap_server_conf,
  -			 "child pid %d exit signal %d",
  -			 pid, WTERMSIG(status));
  -#endif
  -	}
  -    }
  -}
  -
   static int setup_listeners(server_rec *s)
   {
       ap_listen_rec *lr;
  @@ -695,7 +644,7 @@
           ap_wait_or_timeout(&status, &pid, pconf);
           
           if (pid.pid >= 0) {
  -            process_child_status(pid.pid, status);
  +            ap_process_child_status(pid.pid, status);
               /* non-fatal death... note that it's gone in the scoreboard. */
               child_slot = -1;
               for (i = 0; i < ap_max_daemons_limit; ++i) {
  
  
  
  1.5       +1 -0      apache-2.0/src/modules/mpm/mpmt_pthread/mpm.h
  
  Index: mpm.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_pthread/mpm.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- mpm.h	2000/07/05 18:01:20	1.4
  +++ mpm.h	2000/07/10 18:21:22	1.5
  @@ -71,5 +71,6 @@
   extern server_rec *ap_server_conf;
   extern scoreboard *ap_scoreboard_image;
   extern void clean_child_exit(int);
  +extern char ap_coredump_dir[MAX_STRING_LEN];
   
   #endif /* APACHE_MPM_MPMT_PTHREAD_H */
  
  
  
  1.104     +2 -54     apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c
  
  Index: mpmt_pthread.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c,v
  retrieving revision 1.103
  retrieving revision 1.104
  diff -u -r1.103 -r1.104
  --- mpmt_pthread.c	2000/07/05 19:40:04	1.103
  +++ mpmt_pthread.c	2000/07/10 18:21:22	1.104
  @@ -121,7 +121,7 @@
    */
   int ap_max_daemons_limit = -1;
   
  -static char ap_coredump_dir[MAX_STRING_LEN];
  +char ap_coredump_dir[MAX_STRING_LEN];
   
   static ap_file_t *pipe_of_death_in = NULL;
   static ap_file_t *pipe_of_death_out = NULL;
  @@ -373,58 +373,6 @@
   #endif
   }
   
  -static void process_child_status(ap_proc_t *pid, ap_wait_t status)
  -{
  -    /* Child died... if it died due to a fatal error,
  -	* we should simply bail out.
  -	*/
  -    if ((WIFEXITED(status)) &&
  -	WEXITSTATUS(status) == APEXIT_CHILDFATAL) {
  -	ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, 0, ap_server_conf,
  -			"Child %ld returned a Fatal error... \n"
  -			"Apache is exiting!",
  -			(long)pid->pid);
  -	exit(APEXIT_CHILDFATAL);
  -    }
  -    if (WIFSIGNALED(status)) {
  -	switch (WTERMSIG(status)) {
  -	case SIGTERM:
  -	case SIGHUP:
  -	case SIGUSR1:
  -	case SIGKILL:
  -	    break;
  -	default:
  -#ifdef SYS_SIGLIST
  -#ifdef WCOREDUMP
  -	    if (WCOREDUMP(status)) {
  -		ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  -			     0, ap_server_conf,
  -			     "child pid %ld exit signal %s (%d), "
  -			     "possible coredump in %s",
  -			     (long)pid->pid, (WTERMSIG(status) >= NumSIG) ? "" :
  -			     SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status),
  -			     ap_coredump_dir);
  -	    }
  -	    else {
  -#endif
  -		ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  -			     0, ap_server_conf,
  -			     "child pid %ld exit signal %s (%d)", 
  -                             (long)pid->pid,
  -			     SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status));
  -#ifdef WCOREDUMP
  -	    }
  -#endif
  -#else
  -	    ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  -			 0, ap_server_conf,
  -			 "child pid %ld exit signal %d",
  -			 (long)pid->pid, WTERMSIG(status));
  -#endif
  -	}
  -    }
  -}
  -
   static int setup_listeners(server_rec *s)
   {
       ap_listen_rec *lr;
  @@ -1022,7 +970,7 @@
           ap_wait_or_timeout(&status, &pid, pconf);
           
           if (pid.pid != -1) {
  -            process_child_status(&pid, status);
  +            ap_process_child_status(&pid, status);
               /* non-fatal death... note that it's gone in the scoreboard. */
               child_slot = find_child_by_pid(&pid);
               if (child_slot >= 0) {
  
  
  
  1.3       +1 -0      apache-2.0/src/modules/mpm/prefork/mpm.h
  
  Index: mpm.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/prefork/mpm.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- mpm.h	2000/06/06 21:45:14	1.2
  +++ mpm.h	2000/07/10 18:21:22	1.3
  @@ -70,4 +70,5 @@
   extern scoreboard *ap_scoreboard_image;
   extern server_rec *ap_server_conf;
   extern int ap_my_pid;
  +extern char ap_coredump_dir[MAX_STRING_LEN];
   #endif /* APACHE_MPM_DEXTER_H */
  
  
  
  1.114     +2 -55     apache-2.0/src/modules/mpm/prefork/prefork.c
  
  Index: prefork.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/prefork/prefork.c,v
  retrieving revision 1.113
  retrieving revision 1.114
  diff -u -r1.113 -r1.114
  --- prefork.c	2000/07/05 19:40:14	1.113
  +++ prefork.c	2000/07/10 18:21:22	1.114
  @@ -156,7 +156,7 @@
   int ap_max_daemons_limit = -1;
   server_rec *ap_server_conf;
   
  -static char ap_coredump_dir[MAX_STRING_LEN];
  +char ap_coredump_dir[MAX_STRING_LEN];
   
   /* *Non*-shared http_main globals... */
   
  @@ -1283,59 +1283,6 @@
       }
   }
   
  -
  -static void process_child_status(ap_proc_t *pid, ap_wait_t status)
  -{
  -    /* Child died... if it died due to a fatal error,
  -	* we should simply bail out.
  -	*/
  -    if ((WIFEXITED(status)) &&
  -	WEXITSTATUS(status) == APEXIT_CHILDFATAL) {
  -	ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, 0, ap_server_conf,
  -			"Child %ld returned a Fatal error... \n"
  -			"Apache is exiting!",
  -			(long)pid->pid);
  -	exit(APEXIT_CHILDFATAL);
  -    }
  -    if (WIFSIGNALED(status)) {
  -	switch (WTERMSIG(status)) {
  -	case SIGTERM:
  -	case SIGHUP:
  -	case SIGUSR1:
  -	case SIGKILL:
  -	    break;
  -	default:
  -#ifdef SYS_SIGLIST
  -#ifdef WCOREDUMP
  -	    if (WCOREDUMP(status)) {
  -		ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  -			     0, ap_server_conf,
  -			     "child pid %ld exit signal %s (%d), "
  -			     "possible coredump in %s",
  -			     (long)pid->pid, (WTERMSIG(status) >= NumSIG) ? "" : 
  -			     SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status),
  -			     ap_coredump_dir);
  -	    }
  -	    else {
  -#endif
  -		ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  -			     0, ap_server_conf,
  -			     "child pid %ld exit signal %s (%d)", (long)pid->pid,
  -			     SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status));
  -#ifdef WCOREDUMP
  -	    }
  -#endif
  -#else
  -	    ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  -			 0, ap_server_conf,
  -			 "child pid %ld exit signal %d",
  -			 (long)pid->pid, WTERMSIG(status));
  -#endif
  -	}
  -    }
  -}
  -
  -
   static int setup_listeners(server_rec *s)
   {
       ap_listen_rec *lr;
  @@ -1453,7 +1400,7 @@
   	 * extra child
   	 */
   	if (pid.pid != -1) {
  -	    process_child_status(&pid, status);
  +	    ap_process_child_status(&pid, status);
   	    /* non-fatal death... note that it's gone in the scoreboard. */
   	    ap_sync_scoreboard_image();
   	    child_slot = find_child_by_pid(&pid);
  
  
  
  1.2       +2 -0      apache-2.0/src/modules/mpm/spmt_os2/mpm.h
  
  Index: mpm.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/spmt_os2/mpm.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mpm.h	2000/05/28 12:33:04	1.1
  +++ mpm.h	2000/07/10 18:21:23	1.2
  @@ -65,4 +65,6 @@
   
   #define SPMT_OS2_MPM
   
  +extern char ap_coredump_dir[MAX_STRING_LEN];
  +
   #endif /* APACHE_MPM_DEXTER_H */
  
  
  
  1.50      +2 -54     apache-2.0/src/modules/mpm/spmt_os2/spmt_os2.c
  
  Index: spmt_os2.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/spmt_os2/spmt_os2.c,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- spmt_os2.c	2000/07/05 19:40:32	1.49
  +++ spmt_os2.c	2000/07/10 18:21:24	1.50
  @@ -100,7 +100,7 @@
    */
   static int max_daemons_limit = -1;
   
  -static char ap_coredump_dir[MAX_STRING_LEN];
  +char ap_coredump_dir[MAX_STRING_LEN];
   
   /* *Non*-shared http_main globals... */
   
  @@ -1201,58 +1201,6 @@
   }
   
   
  -static void process_child_status(int tid, ap_wait_t status)
  -{
  -    /* Child died... if it died due to a fatal error,
  -	* we should simply bail out.
  -	*/
  -    if ((WIFEXITED(status)) &&
  -	WEXITSTATUS(status) == APEXIT_CHILDFATAL) {
  -	ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, 0, server_conf,
  -			"Child %d returned a Fatal error... \n"
  -			"Apache is exiting!",
  -			tid);
  -	exit(APEXIT_CHILDFATAL);
  -    }
  -    if (WIFSIGNALED(status)) {
  -	switch (WTERMSIG(status)) {
  -	case SIGTERM:
  -	case SIGHUP:
  -	case SIGUSR1:
  -	case SIGKILL:
  -	    break;
  -	default:
  -#ifdef SYS_SIGLIST
  -#ifdef WCOREDUMP
  -	    if (WCOREDUMP(status)) {
  -		ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0,
  -			     server_conf,
  -			     "child tid %d exit signal %s (%d), "
  -			     "possible coredump in %s",
  -			     tid, (WTERMSIG(status) >= NumSIG) ? "" :
  -			     SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status),
  -			     ap_coredump_dir);
  -	    }
  -	    else {
  -#endif
  -		ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0,
  -			     server_conf,
  -			     "child tid %d exit signal %s (%d)", tid,
  -			     SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status));
  -#ifdef WCOREDUMP
  -	    }
  -#endif
  -#else
  -	    ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0,
  -			 server_conf,
  -			 "child tid %d exit signal %d",
  -			 tid, WTERMSIG(status));
  -#endif
  -	}
  -    }
  -}
  -
  -
   /*****************************************************************
    * Executive routines.
    */
  @@ -1333,7 +1281,7 @@
   	 * extra child
   	 */
   	if (tid >= 0) {
  -	    process_child_status(tid, status);
  +	    ap_process_child_status(tid, status);
   	    /* non-fatal death... note that it's gone in the scoreboard. */
   	    child_slot = find_child_by_tid(tid);
   	    if (child_slot >= 0) {
  
  
  

Mime
View raw message