apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr-util/include apr_sdbm.h
Date Sun, 06 May 2001 12:58:05 GMT
wrowe       01/05/06 05:58:05

  Modified:    dbm      apr_dbm.c
               dbm/sdbm sdbm.c sdbm_private.h
               include  apr_sdbm.h
  Log:
    Eliminate apr sdbm error cache [previously eliminated apr sdbm err flag.]
    Functions now return apr_status_t.
  
  Revision  Changes    Path
  1.24      +2 -6      apr-util/dbm/apr_dbm.c
  
  Index: apr_dbm.c
  ===================================================================
  RCS file: /home/cvs/apr-util/dbm/apr_dbm.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- apr_dbm.c	2001/05/02 13:37:52	1.23
  +++ apr_dbm.c	2001/05/06 12:58:04	1.24
  @@ -311,7 +311,7 @@
   
   #if APU_USE_SDBM
   
  -    if ((dbm->errcode = apr_sdbm_error_get(dbm->file)) == 0) {
  +    if ((dbm->errcode = dbm_said) == 0) {
           dbm->errmsg = NULL;
       }
       else {
  @@ -319,9 +319,6 @@
           rv = APR_EGENERAL;        /* ### need something better */
       }
   
  -    /* captured it. clear it now. */
  -    apr_sdbm_error_clear(dbm->file);
  -
   #elif APU_USE_GDBM
   
       if ((dbm->errcode = gdbm_errno) == GDBM_NO_ERROR) {
  @@ -503,8 +500,7 @@
       {
   	apr_sdbm_datum_t value;
           if (apr_sdbm_fetch(dbm->file, &value, *ckey) != APR_SUCCESS) {
  -	    apr_sdbm_error_clear(dbm->file);	/* don't need the error */
  -            exists = 0;
  +	    exists = 0;
           }
           else
               exists = value.dptr != NULL;
  
  
  
  1.19      +5 -23     apr-util/dbm/sdbm/sdbm.c
  
  Index: sdbm.c
  ===================================================================
  RCS file: /home/cvs/apr-util/dbm/sdbm/sdbm.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- sdbm.c	2001/05/02 13:37:53	1.18
  +++ sdbm.c	2001/05/06 12:58:05	1.19
  @@ -85,11 +85,8 @@
   /*
    * useful macros
    */
  -#define SDBM_IOERR	0x2	       /* data base I/O error */
  -
   #define bad(x)		((x).dptr == NULL || (x).dsize <= 0)
   #define exhash(item)	sdbm_hash((item).dptr, (item).dsize)
  -#define ioerr(db,stat)	((db)->status = (stat))
   
   /* ### Does anything need these externally? */
   #define sdbm_dirfno(db)	((db)->dirf)
  @@ -143,7 +140,7 @@
        * flag for RDONLY if needed.
        */
       if (!(flags & APR_WRITE)) {
  -        db->flags = SDBM_RDONLY;
  +        db->flags |= SDBM_RDONLY;
       }
   
       flags |= APR_BINARY | APR_READ;
  @@ -228,7 +225,6 @@
           return APR_SUCCESS;
       }
   
  -    ioerr(db, status);
       return status;
   }
   
  @@ -240,7 +236,6 @@
       if ((status = apr_file_seek(db->pagf, APR_SET, &off)) != APR_SUCCESS ||
           (status = apr_file_write_full(db->pagf, buf, PBLKSIZ, NULL)) 
                   != APR_SUCCESS) {
  -        ioerr(db, status);
           return status;
       }
       
  @@ -270,7 +265,6 @@
           return APR_SUCCESS;
       }
   
  -    ioerr(db, status);
       return APR_EACCES;
   }
   
  @@ -321,7 +315,6 @@
           return APR_SUCCESS;
       }
       
  -    ioerr(db, status);
       return status;
   }
   
  @@ -439,7 +432,6 @@
       apr_status_t status;
       if ((status = read_from(db->pagf, db->pagbuf, OFF_PAG(0), PBLKSIZ))
                   != APR_SUCCESS) {
  -        ioerr(db, status);
           return status;
       }
   
  @@ -488,8 +480,7 @@
            * ### we make it so in read_from anyway.
            */
           if ((status = read_from(db->pagf, db->pagbuf, OFF_PAG(pagb), PBLKSIZ)) 
  -            != APR_SUCCESS) {
  -            ioerr(db, status);
  +                    != APR_SUCCESS) {
               return status;
           }
   
  @@ -580,16 +571,16 @@
               apr_off_t off = OFF_PAG(db->blkptr);
               if ((status = apr_file_seek(db->pagf, APR_SET, &off) 
                           != APR_SUCCESS))
  -                return ioerr(db, status);
  +                return status;
           }
   
           db->pagbno = db->blkptr;
           /* ### EOF acceptable here too? */
           if ((status = apr_file_read_full(db->pagf, db->pagbuf, PBLKSIZ, NULL))
                       != APR_SUCCESS)
  -            return ioerr(db, status);
  +            return status;
           if (!chkpage(db->pagbuf))
  -            return ioerr(db, APR_EGENERAL);     /* ### need better error */
  +            return APR_EGENERAL;     /* ### need better error */
       }
   
       /* NOTREACHED */
  @@ -601,12 +592,3 @@
       return (db->flags & SDBM_RDONLY) != 0;
   }
   
  -apr_status_t apr_sdbm_error_get(apr_sdbm_t *db)
  -{
  -    return db->status;
  -}
  -
  -void apr_sdbm_error_clear(apr_sdbm_t *db)
  -{
  -    db->status = APR_SUCCESS;
  -}
  
  
  
  1.6       +1 -3      apr-util/dbm/sdbm/sdbm_private.h
  
  Index: sdbm_private.h
  ===================================================================
  RCS file: /home/cvs/apr-util/dbm/sdbm/sdbm_private.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- sdbm_private.h	2001/04/30 17:16:23	1.5
  +++ sdbm_private.h	2001/05/06 12:58:05	1.6
  @@ -80,13 +80,12 @@
   
   /* for apr_sdbm_t.flags */
   #define SDBM_RDONLY	0x1	       /* data base open read-only */
  -#define SDBM_SHARED	0x4	       /* data base locks for shared write */
   
   struct apr_sdbm_t {
       apr_pool_t *pool;
       apr_file_t *dirf;		       /* directory file descriptor */
       apr_file_t *pagf;		       /* page file descriptor */
  -    apr_int32_t flags;		       /* status/error flags, see below */
  +    apr_int32_t flags;		       /* status/error flags, see above */
       long maxbno;		       /* size of dirfile in bits */
       long curbit;		       /* current bit number */
       long hmask;			       /* current hash mask */
  @@ -97,7 +96,6 @@
       char pagbuf[PBLKSIZ];	       /* page file block buffer */
       long dirbno;		       /* current block in dirbuf */
       char dirbuf[DBLKSIZ];	       /* directory file block buffer */
  -    apr_status_t status;               /* track the specific last error */
   };
   
   apr_status_t sdbm_lock(apr_sdbm_t *db, int exclusive);
  
  
  
  1.7       +0 -2      apr-util/include/apr_sdbm.h
  
  Index: apr_sdbm.h
  ===================================================================
  RCS file: /home/cvs/apr-util/include/apr_sdbm.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- apr_sdbm.h	2001/05/02 13:37:52	1.6
  +++ apr_sdbm.h	2001/05/06 12:58:05	1.7
  @@ -69,8 +69,6 @@
   
   /* utility functions */
   int apr_sdbm_rdonly(apr_sdbm_t *db);
  -apr_status_t apr_sdbm_error_get(apr_sdbm_t *db);
  -void apr_sdbm_error_clear(apr_sdbm_t *db);
   
   typedef struct {
       char *dptr;
  
  
  

Mime
View raw message