httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@hyperreal.org
Subject cvs commit: apache-apr/pthreads/src/main acceptlock.c scoreboard.c
Date Sun, 07 Mar 1999 00:47:54 GMT
rbb         99/03/06 16:47:53

  Modified:    pthreads/src/include acceptlock.h httpd.h
               pthreads/src/main acceptlock.c scoreboard.c
  Log:
  Modifications to make the acceptlock abstractions work on Linux.
  
  Revision  Changes    Path
  1.2       +0 -1      apache-apr/pthreads/src/include/acceptlock.h
  
  Index: acceptlock.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/acceptlock.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- acceptlock.h	1999/03/05 16:45:57	1.1
  +++ acceptlock.h	1999/03/07 00:47:43	1.2
  @@ -90,7 +90,6 @@
   void accept_mutex_off(int);
   
   #elif defined(USE_FLOCK_SERIALIZED_ACCEPT)
  -#define accept_mutex_child_init(x)
   void accept_mutex_cleanup(void *);
   void accept_mutex_child_init(pool *);
   void accept_mutex_init(pool *);
  
  
  
  1.10      +1 -1      apache-apr/pthreads/src/include/httpd.h
  
  Index: httpd.h
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/include/httpd.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- httpd.h	1999/02/24 20:30:14	1.9
  +++ httpd.h	1999/03/07 00:47:44	1.10
  @@ -1039,7 +1039,7 @@
   API_EXPORT(int) ap_can_exec(const struct stat *);
   API_EXPORT(void) ap_chdir_file(const char *file);
   API_EXPORT(int) ap_get_max_daemons(void);
  -server_rec * get_server_conf(void);
  +API_EXPORT(const server_rec *) ap_get_server_conf(void);
   
   #ifndef HAVE_CANONICAL_FILENAME
   /*
  
  
  
  1.2       +28 -24    apache-apr/pthreads/src/main/acceptlock.c
  
  Index: acceptlock.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/acceptlock.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- acceptlock.c	1999/03/05 16:45:55	1.1
  +++ acceptlock.c	1999/03/07 00:47:49	1.2
  @@ -478,31 +478,32 @@
   void accept_mutex_cleanup(void *foo)
   {
       int i;
  -
  +  
       char * lock_fname;
       for (i = 0; i < ap_acceptors_per_child; i++) {
           lock_fname = expand_lock_fname(foo, i);
  -	unlink(lock_fname);
  +        unlink(lock_fname);
       }
   }
   
   /*
    * Initialize mutex lock.
    * Done by each child at it's birth
  - */
  + */ 
   void accept_mutex_child_init(pool *p)
   {
       int i;
  -    
  +  
       for (i = 0; i < ap_acceptors_per_child; i++) {
           char *lock_fname = expand_lock_fname(p, i);
  -      
  -	lock_fd[i] = ap_popenf(p, lock_fname, O_WRONLY, 0600);
  -	if (lock_fd[i] == -1) {
  -	  ap_log_error(APLOG_MARK, APLOG_EMERG, ap_get_server_conf(),
  +    
  +        lock_fd[i] = ap_popenf(p, lock_fname, O_WRONLY, 0600);
  +        if (lock_fd[i] == -1) {
  +	  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);
  -	}
  +        }
       }
   }
   
  @@ -513,20 +514,21 @@
   void accept_mutex_init(pool *p)
   {
       int i;
  -    char * lock_fname;
  +    char *lock_fname;
       lock_fd = (int *)ap_palloc(p, ap_acceptors_per_child * sizeof(int *));
  -
  +  
       for (i = 0; i < ap_acceptors_per_child; i++) {
           lock_fname = expand_lock_fname(p, i);
  -	unlink(lock_fname);
  -	lock_fd[i] = ap_popenf(p, lock_fname, 
  +        unlink(lock_fname);
  +        lock_fd[i] = ap_popenf(p, lock_fname, 
   			       O_CREAT | O_WRONLY | O_EXCL, 0600);
  -	if (lock_fd[i] == -1) {
  -	  ap_log_error(APLOG_MARK, APLOG_EMERG, ap_get_server_conf(),
  -		       "Parent cannot open lock file: %s", lock_fname);
  -	  exit(APEXIT_INIT);
  -	}
  -	ap_register_cleanup(p, p, accept_mutex_cleanup, ap_null_cleanup);
  +        if (lock_fd[i] == -1) {
  +	    ap_log_error(APLOG_MARK, APLOG_EMERG, 
  +			 (const server_rec *) ap_get_server_conf(), 
  +			 "Parent cannot open lock file: %s", lock_fname);
  +            exit(APEXIT_INIT);
  +        }
  +        ap_register_cleanup(p, p, accept_mutex_cleanup, ap_null_cleanup);
       }
   }
   
  @@ -535,11 +537,12 @@
       int ret;
   
       while ((ret = flock(lock_fd[locknum], LOCK_EX)) < 0 && errno != EINTR)
  -	continue;
  +        continue;
   
       if (ret < 0 && errno != EINTR) {
  -	ap_log_error(APLOG_MARK, APLOG_EMERG, ap_get_server_conf(),
  -		    "flock: LOCK_EX: Error getting accept lock. Exiting!");
  +        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);
       }
   }
  @@ -547,8 +550,9 @@
   void accept_mutex_off(int locknum)
   {
       if (flock(lock_fd[locknum], LOCK_UN) < 0 && errno != EINTR) {
  -	ap_log_error(APLOG_MARK, APLOG_EMERG, ap_get_server_conf(),
  -		    "flock: LOCK_UN: Error freeing accept lock. Exiting!");
  +        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);
       }
   }
  
  
  
  1.5       +1 -1      apache-apr/pthreads/src/main/scoreboard.c
  
  Index: scoreboard.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/scoreboard.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- scoreboard.c	1999/02/15 20:39:01	1.4
  +++ scoreboard.c	1999/03/07 00:47:50	1.5
  @@ -309,7 +309,7 @@
   static void setup_shared_mem(pool *p)
   {
       struct shmid_ds shmbuf;
  -    server_rec * server_conf = get_server_conf();
  +    server_rec * server_conf = ap_get_server_conf();
   #ifdef MOVEBREAK
       char *obrk;
   #endif
  
  
  

Mime
View raw message