Return-Path: Delivered-To: apache-cvs-archive@hyperreal.org Received: (qmail 2314 invoked by uid 6000); 12 Sep 1999 11:09:50 -0000 Received: (qmail 2307 invoked by uid 2016); 12 Sep 1999 11:09:48 -0000 Delivered-To: apcore-apache-2.0-cvs@apache.org Received: (qmail 2305 invoked by uid 124); 12 Sep 1999 11:09:48 -0000 Date: 12 Sep 1999 11:09:48 -0000 Message-ID: <19990912110948.2304.qmail@hyperreal.org> From: ben@hyperreal.org To: apache-2.0-cvs@apache.org Subject: cvs commit: apache-2.0/src/lib/apr/locks/unix crossproc.c Sender: apache-cvs-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org 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 #include @@ -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; }