You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2004/04/30 20:26:09 UTC

DO NOT REPLY [Bug 28718] New: - apr_sdbm_lock does not pass the APR_FLOCK_NONBLOCK flag to apr_file_lock

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28718>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=28718

apr_sdbm_lock does not pass the APR_FLOCK_NONBLOCK flag to apr_file_lock 

           Summary: apr_sdbm_lock does not pass the APR_FLOCK_NONBLOCK flag
                    to apr_file_lock
           Product: Apache httpd-2.0
           Version: 2.0.49
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Core
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: ebruno@solution-soft.com


apr-util/dbm/apr_sdbm_lock does not pass the APR_FLOCK_NONBLOCK flag to 
apr_file_lock. This is because of the way type is tested in function.

It is minor change that will not affect exising code to allow 
APR_FLOCK_NONBLOCK to passed through apr_sdbm_lock to apr_file_lock

diff shown below:
diff -C 3 sdbm_lock_old.c sdbm_lock.c
*** sdbm_lock_old.c     Fri Feb 13 01:52:42 2004
--- sdbm_lock.c Fri Apr 30 11:18:35 2004
***************
*** 21,30 ****
  #include "sdbm_tune.h"

  /* NOTE: this function blocks until it acquires the lock */
! APU_DECLARE(apr_status_t) apr_sdbm_lock(apr_sdbm_t *db, int type)
  {
      apr_status_t status;
!
      if (!(type == APR_FLOCK_SHARED || type == APR_FLOCK_EXCLUSIVE))
          return APR_EINVAL;

--- 21,31 ----
  #include "sdbm_tune.h"

  /* NOTE: this function blocks until it acquires the lock */
! APU_DECLARE(apr_status_t) apr_sdbm_lock(apr_sdbm_t *db, int intype)
  {
      apr_status_t status;
!     int type;
!     type = (intype & APR_FLOCK_TYPEMASK);
      if (!(type == APR_FLOCK_SHARED || type == APR_FLOCK_EXCLUSIVE))
          return APR_EINVAL;

***************
*** 46,52 ****
       * zero size: either a fresh database, or one with a single,
       * unsplit data page: dirpage is all zeros.
       */
!     if ((status = apr_file_lock(db->dirf, type)) == APR_SUCCESS)
      {
          apr_finfo_t finfo;
          if ((status = apr_file_info_get(&finfo, APR_FINFO_SIZE, db->dirf))
--- 47,53 ----
       * zero size: either a fresh database, or one with a single,
       * unsplit data page: dirpage is all zeros.
       */
!     if ((status = apr_file_lock(db->dirf, intype)) == APR_SUCCESS)
      {
          apr_finfo_t finfo;
          if ((status = apr_file_info_get(&finfo, APR_FINFO_SIZE, db->dirf))

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org