From commits-return-8465-apmail-apr-commits-archive=apr.apache.org@apr.apache.org Sun Jul 22 00:14:28 2007 Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 14486 invoked from network); 22 Jul 2007 00:14:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Jul 2007 00:14:27 -0000 Received: (qmail 8736 invoked by uid 500); 22 Jul 2007 00:14:29 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 8642 invoked by uid 500); 22 Jul 2007 00:14:29 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 8631 invoked by uid 99); 22 Jul 2007 00:14:29 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 Jul 2007 17:14:29 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 Jul 2007 17:14:26 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id B0A6C1A981A; Sat, 21 Jul 2007 17:14:06 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r558403 - /apr/apr-util/trunk/dbm/sdbm/sdbm_lock.c Date: Sun, 22 Jul 2007 00:14:06 -0000 To: commits@apr.apache.org From: davi@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070722001406.B0A6C1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: davi Date: Sat Jul 21 17:14:05 2007 New Revision: 558403 URL: http://svn.apache.org/viewvc?view=rev&rev=558403 Log: Use the APR_FLOCK_TYPEMASK mask to extract the lock type (shared or exclusive) while still preserving the other bits. This change allows the APR_FLOCK_NONBLOCK flag to be passed to apr_file_lock(). PR: 28718 Modified: apr/apr-util/trunk/dbm/sdbm/sdbm_lock.c Modified: apr/apr-util/trunk/dbm/sdbm/sdbm_lock.c URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbm/sdbm/sdbm_lock.c?view=diff&rev=558403&r1=558402&r2=558403 ============================================================================== --- apr/apr-util/trunk/dbm/sdbm/sdbm_lock.c (original) +++ apr/apr-util/trunk/dbm/sdbm/sdbm_lock.c Sat Jul 21 17:14:05 2007 @@ -21,12 +21,13 @@ #include "sdbm_private.h" #include "sdbm_tune.h" -/* NOTE: this function blocks until it acquires the lock */ +/* NOTE: this function may block until it acquires the lock */ APU_DECLARE(apr_status_t) apr_sdbm_lock(apr_sdbm_t *db, int type) { apr_status_t status; + int lock_type = type & APR_FLOCK_TYPEMASK; - if (!(type == APR_FLOCK_SHARED || type == APR_FLOCK_EXCLUSIVE)) + if (!(lock_type == APR_FLOCK_SHARED || lock_type == APR_FLOCK_EXCLUSIVE)) return APR_EINVAL; if (db->flags & SDBM_EXCLUSIVE_LOCK) {