ben         99/09/12 04:09:48

  Modified:    src/lib/apr/locks/unix crossproc.c
  Log:
  Fix numerous cockups where values are tested instead of set, and a few 
warnings.
  
  Revision  Changes    Path
  1.3       +9 -6      apache-2.0/src/lib/apr/locks/unix/crossproc.c
  
  Index: crossproc.c
  ===================================================================
  RCS file: /export/home/cvs/apache-2.0/src/lib/apr/locks/unix/crossproc.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- crossproc.c       1999/08/31 05:32:41     1.2
  +++ crossproc.c       1999/09/12 11:09:47     1.3
  @@ -55,6 +55,7 @@
   
   #include "apr_lock.h"
   #include "apr_general.h"
  +#include "apr_lib.h"
   #include "locks.h"
   #include <unistd.h>
   #include <sys/mman.h>
  @@ -229,13 +230,15 @@
   
   #elif defined (USE_FCNTL_SERIALIZE)  
   
  -ap_status_t lock_cleanup(struct lock_t *lock)
  +ap_status_t lock_cleanup(void *lock_)
   {
  +    struct lock_t *lock=lock_;
  +
       if (lock->curr_locked == 1) {
           if (fcntl(lock->interproc, F_SETLKW, &lock->unlock_it) < 0) {
               return errno;
           }
  -        lock->curr_locked == 0;
  +        lock->curr_locked=0;
       }
       return APR_SUCCESS;
   }    
  @@ -260,15 +263,15 @@
       new->unlock_it.l_type = F_UNLCK;         /* set exclusive/write lock */
       new->unlock_it.l_pid = 0;                /* pid not actually interesting 
*/
   
  -    new->curr_locked == 0;
  +    new->curr_locked=0;
       unlink(new->fname);
  -    ap_register_cleanup(new->cntxt, (void *)new, lock_cleanup, NULL);
  +    ap_register_cleanup(new->cntxt, new, lock_cleanup, NULL);
       return APR_SUCCESS; 
   }
   
   ap_status_t lock_inter(struct lock_t *lock)
   {
  -    lock->curr_locked == 1;
  +    lock->curr_locked=1;
       if (fcntl(lock->interproc, F_SETLKW, &lock->lock_it) < 0) {
           return errno;
       }
  @@ -280,7 +283,7 @@
       if (fcntl(lock->interproc, F_SETLKW, &lock->unlock_it) < 0) {
           return errno;
       }
  -    lock->curr_locked == 0;
  +    lock->curr_locked=0;
       return APR_SUCCESS;
   }
   
  
  
  

Reply via email to