You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rs...@hyperreal.org on 1999/08/28 14:38:00 UTC

cvs commit: apache-2.0/src/modules/mpm/dexter acceptlock.c dexter.c dexter.h

rse         99/08/28 05:38:00

  Modified:    src/modules/mpm/dexter acceptlock.c dexter.c dexter.h
  Log:
  clean_child_exit() is really used globally inside dexter MPM,
  so rename it to ap_clean_child_exit().
  
  Revision  Changes    Path
  1.2       +19 -19    apache-2.0/src/modules/mpm/dexter/acceptlock.c
  
  Index: acceptlock.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/dexter/acceptlock.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- acceptlock.c	1999/07/21 19:07:05	1.1
  +++ acceptlock.c	1999/08/28 12:37:58	1.2
  @@ -67,7 +67,7 @@
   #include "util_script.h"	/* to force util_script.c linking */ 
   #include "util_uri.h" 
   #include "acceptlock.h"
  -#include "dexter.h"	/* For clean_child_exit */
  +#include "dexter.h"	/* For ap_clean_child_exit */
   #include "unixd.h"
   #include <netinet/tcp.h> 
   #include <stdio.h> 
  @@ -111,7 +111,7 @@
       for (i = 0; i < intra_lock_count; i++) {
           if (pthread_mutex_init(&intra_mutex[i], NULL) != 0) {
               perror("intra_mutex_init");
  -	    clean_child_exit(APEXIT_CHILDFATAL);
  +	    ap_clean_child_exit(APEXIT_CHILDFATAL);
           }
       }
       ap_register_cleanup(p, NULL, intra_mutex_cleanup, ap_null_cleanup);
  @@ -201,10 +201,10 @@
   	break;
       case 0:
   	fprintf(stderr, "didn't get lock\n");
  -	clean_child_exit(APEXIT_CHILDFATAL);
  +	ap_clean_child_exit(APEXIT_CHILDFATAL);
       case -1:
   	perror("ussetlock");
  -	clean_child_exit(APEXIT_CHILDFATAL);
  +	ap_clean_child_exit(APEXIT_CHILDFATAL);
       }
   }
   
  @@ -212,7 +212,7 @@
   {
       if (usunsetlock(uslock[locknum]) == -1) {
   	perror("usunsetlock");
  -	clean_child_exit(APEXIT_CHILDFATAL);
  +	ap_clean_child_exit(APEXIT_CHILDFATAL);
       }
   }
   
  @@ -327,13 +327,13 @@
       if (pthread_sigmask(SIG_BLOCK, &accept_block_mask,
                           &accept_previous_mask[locknum])) {
   	perror("pthread_sigmask(SIG_BLOCK)");
  -	clean_child_exit(APEXIT_CHILDFATAL);
  +	ap_clean_child_exit(APEXIT_CHILDFATAL);
       }
   #endif
       if ((err = pthread_mutex_lock(&accept_mutex[locknum]))) {
   	errno = err;
   	perror("pthread_mutex_lock");
  -	clean_child_exit(APEXIT_CHILDFATAL);
  +	ap_clean_child_exit(APEXIT_CHILDFATAL);
       }
       have_accept_mutex[locknum] = 1;
   }
  @@ -345,7 +345,7 @@
       if ((err = pthread_mutex_unlock(&accept_mutex[locknum]))) {
   	errno = err;
   	perror("pthread_mutex_unlock");
  -	clean_child_exit(APEXIT_CHILDFATAL);
  +	ap_clean_child_exit(APEXIT_CHILDFATAL);
       }
       /* There is a slight race condition right here... if we were to die right
        * now, we'd do another pthread_mutex_unlock.  Now, doing that would let
  @@ -364,7 +364,7 @@
   #ifdef NEED_TO_BLOCK_SIGNALS_AROUND_PTHREAD_CALLS
       if (pthread_sigmask(SIG_SETMASK, &accept_previous_mask[locknum], NULL)) {
   	perror("pthread_sigmask(SIG_SETMASK)");
  -	clean_child_exit(1);
  +	ap_clean_child_exit(1);
       }
   #endif
   }
  @@ -459,7 +459,7 @@
   {
       if (semop(sem_id[locknum], &op_on, 1) < 0) {
   	perror("accept_mutex_on");
  -	clean_child_exit(APEXIT_CHILDFATAL);
  +	ap_clean_child_exit(APEXIT_CHILDFATAL);
       }
   }
   
  @@ -467,7 +467,7 @@
   {
       if (semop(sem_id[locknum], &op_off, 1) < 0) {
   	perror("accept_mutex_off");
  -	clean_child_exit(APEXIT_CHILDFATAL);
  +	ap_clean_child_exit(APEXIT_CHILDFATAL);
       }
   }
   
  @@ -527,7 +527,7 @@
   		    "fcntl: F_SETLKW: Error getting accept lock, exiting!  "
   		    "Perhaps you need to use the LockFile directive to place "
   		    "your lock file on a local disk!");
  -	clean_child_exit(APEXIT_CHILDFATAL);
  +	ap_clean_child_exit(APEXIT_CHILDFATAL);
       }
   }
   
  @@ -544,7 +544,7 @@
   		    "fcntl: F_SETLKW: Error freeing accept lock, exiting!  "
   		    "Perhaps you need to use the LockFile directive to place "
   		    "your lock file on a local disk!");
  -	clean_child_exit(APEXIT_CHILDFATAL);
  +	ap_clean_child_exit(APEXIT_CHILDFATAL);
       }
   }
   
  @@ -579,7 +579,7 @@
   	  ap_log_error(APLOG_MARK, APLOG_EMERG, 
   		       (const server_rec *)ap_get_server_conf(),
   		       "Child cannot open lock file: %s", lock_fname);
  -	  clean_child_exit(APEXIT_CHILDINIT);
  +	  ap_clean_child_exit(APEXIT_CHILDINIT);
           }
       }
   }
  @@ -622,7 +622,7 @@
           ap_log_error(APLOG_MARK, APLOG_EMERG, 
   		     (const server_rec *) ap_get_server_conf(),
   		     "flock: LOCK_EX: Error getting accept lock. Exiting!");
  -	clean_child_exit(APEXIT_CHILDFATAL);
  +	ap_clean_child_exit(APEXIT_CHILDFATAL);
       }
   }
   
  @@ -632,7 +632,7 @@
           ap_log_error(APLOG_MARK, APLOG_EMERG, 
   		     (const server_rec *) ap_get_server_conf(),
   		     "flock: LOCK_UN: Error freeing accept lock. Exiting!");
  -	clean_child_exit(APEXIT_CHILDFATAL);
  +	ap_clean_child_exit(APEXIT_CHILDFATAL);
       }
   }
   
  @@ -664,7 +664,7 @@
   	if (rc != 0) {
   	    ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_EMERG, ap_get_server_conf(),
   			 "Child cannot open lock semaphore, rc=%d", rc);
  -	    clean_child_exit(APEXIT_CHILDINIT);
  +	    ap_clean_child_exit(APEXIT_CHILDINIT);
   	}
       }
   }
  @@ -700,7 +700,7 @@
       if (rc != 0) {
   	ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_EMERG, ap_get_server_conf(),
   		    "OS2SEM: Error %d getting accept lock. Exiting!", rc);
  -	clean_child_exit(APEXIT_CHILDFATAL);
  +	ap_clean_child_exit(APEXIT_CHILDFATAL);
       }
   }
   
  @@ -711,7 +711,7 @@
       if (rc != 0) {
   	ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_EMERG, ap_get_server_conf(),
   		    "OS2SEM: Error %d freeing accept lock. Exiting!", rc);
  -	clean_child_exit(APEXIT_CHILDFATAL);
  +	ap_clean_child_exit(APEXIT_CHILDFATAL);
       }
   }
   
  
  
  
  1.32      +4 -4      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.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- dexter.c	1999/08/28 12:32:11	1.31
  +++ dexter.c	1999/08/28 12:37:58	1.32
  @@ -183,8 +183,8 @@
   }
   
   /* a clean exit from a child with proper cleanup 
  -   static void clean_child_exit(int code) __attribute__ ((noreturn)); */
  -static void clean_child_exit(int code)
  +   static void ap_clean_child_exit(int code) __attribute__ ((noreturn)); */
  +void ap_clean_child_exit(int code)
   {
       if (pchild) {
   	ap_destroy_pool(pchild);
  @@ -456,7 +456,7 @@
   
   static void just_die(int sig)
   {
  -    clean_child_exit(0);
  +    ap_clean_child_exit(0);
   }
   
   /*****************************************************************
  @@ -986,7 +986,7 @@
       SAFE_ACCEPT(accept_mutex_child_init(pchild));
   
       if (unixd_setup_child()) {
  -	clean_child_exit(APEXIT_CHILDFATAL);
  +	ap_clean_child_exit(APEXIT_CHILDFATAL);
       }
   
       ap_child_init_hook(pchild, server_conf);
  
  
  
  1.3       +1 -1      apache-2.0/src/modules/mpm/dexter/dexter.h
  
  Index: dexter.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/dexter/dexter.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- dexter.h	1999/07/23 22:15:15	1.2
  +++ dexter.h	1999/08/28 12:37:59	1.3
  @@ -59,6 +59,6 @@
   #define APACHE_MPM_MPMT_PTHREAD_H
   
   extern int max_daemons_limit;
  -extern void clean_child_exit(int);
  +extern void ap_clean_child_exit(int);
   
   #endif /* APACHE_MPM_MPMT_PTHREAD_H */