db-1.85-errno.patch
authorEduardo Lima (Etrunko) <eduardo.lima@intel.com>
Wed, 11 Dec 2013 13:27:46 +0000 (11:27 -0200)
committerEduardo Lima (Etrunko) <eduardo.lima@intel.com>
Wed, 11 Dec 2013 15:09:47 +0000 (13:09 -0200)
Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
db.1.85/hash/hash.c
db.1.85/hash/hash.h
db.1.85/hash/ndbm.c
packaging/db-1.85-errno.patch [deleted file]
packaging/libdb.spec

index 4b7b732..af654ac 100644 (file)
@@ -505,7 +505,7 @@ flush_meta(hashp)
        else
                if (wsize != sizeof(HASHHDR)) {
                        errno = EFTYPE;
-                       hashp->errno = errno;
+                       hashp->err = errno;
                        return (-1);
                }
        for (i = 0; i < NCACHED; i++)
@@ -536,7 +536,7 @@ hash_get(dbp, key, data, flag)
 
        hashp = (HTAB *)dbp->internal;
        if (flag) {
-               hashp->errno = errno = EINVAL;
+               hashp->err = errno = EINVAL;
                return (ERROR);
        }
        return (hash_access(hashp, HASH_GET, (DBT *)key, data));
@@ -553,11 +553,11 @@ hash_put(dbp, key, data, flag)
 
        hashp = (HTAB *)dbp->internal;
        if (flag && flag != R_NOOVERWRITE) {
-               hashp->errno = errno = EINVAL;
+               hashp->err = errno = EINVAL;
                return (ERROR);
        }
        if ((hashp->flags & O_ACCMODE) == O_RDONLY) {
-               hashp->errno = errno = EPERM;
+               hashp->err = errno = EPERM;
                return (ERROR);
        }
        return (hash_access(hashp, flag == R_NOOVERWRITE ?
@@ -574,11 +574,11 @@ hash_delete(dbp, key, flag)
 
        hashp = (HTAB *)dbp->internal;
        if (flag && flag != R_CURSOR) {
-               hashp->errno = errno = EINVAL;
+               hashp->err = errno = EINVAL;
                return (ERROR);
        }
        if ((hashp->flags & O_ACCMODE) == O_RDONLY) {
-               hashp->errno = errno = EPERM;
+               hashp->err = errno = EPERM;
                return (ERROR);
        }
        return (hash_access(hashp, HASH_DELETE, (DBT *)key, NULL));
@@ -729,7 +729,7 @@ hash_seq(dbp, key, data, flag)
 
        hashp = (HTAB *)dbp->internal;
        if (flag && flag != R_FIRST && flag != R_NEXT) {
-               hashp->errno = errno = EINVAL;
+               hashp->err = errno = EINVAL;
                return (ERROR);
        }
 #ifdef HASH_STATISTICS
index 913e82b..fe84d32 100644 (file)
@@ -103,7 +103,7 @@ typedef struct htab  {              /* Memory resident data structure */
        BUFHEAD         *cpage;         /* Current page */
        int             cbucket;        /* Current bucket */
        int             cndx;           /* Index of next item on cpage */
-       int             errno;          /* Error Number -- for DBM 
+       int             err;            /* Error Number -- for DBM 
                                         * compatability */
        int             new_file;       /* Indicates if fd is backing store 
                                         * or no */
index 2cbbe91..f2b7b69 100644 (file)
@@ -180,7 +180,7 @@ dbm_error(db)
        HTAB *hp;
 
        hp = (HTAB *)db->internal;
-       return (hp->errno);
+       return (hp->err);
 }
 
 extern int
@@ -190,7 +190,7 @@ dbm_clearerr(db)
        HTAB *hp;
 
        hp = (HTAB *)db->internal;
-       hp->errno = 0;
+       hp->err = 0;
        return (0);
 }
 
diff --git a/packaging/db-1.85-errno.patch b/packaging/db-1.85-errno.patch
deleted file mode 100644 (file)
index ccc9ddf..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-glibc doesn't like errno as the name of a field.
---- db.1.85/hash/hash.h        Mon Feb 18 19:12:14 2002
-+++ db.1.85/hash/hash.h        Mon Feb 18 19:12:20 2002
-@@ -103,7 +103,7 @@
-       BUFHEAD         *cpage;         /* Current page */
-       int             cbucket;        /* Current bucket */
-       int             cndx;           /* Index of next item on cpage */
--      int             errno;          /* Error Number -- for DBM 
-+      int             err;            /* Error Number -- for DBM 
-                                        * compatability */
-       int             new_file;       /* Indicates if fd is backing store 
-                                        * or no */
---- db.1.85/hash/hash.c        Mon Feb 18 19:12:24 2002
-+++ db.1.85/hash/hash.c        Mon Feb 18 19:12:44 2002
-@@ -505,7 +505,7 @@
-       else
-               if (wsize != sizeof(HASHHDR)) {
-                       errno = EFTYPE;
--                      hashp->errno = errno;
-+                      hashp->err = errno;
-                       return (-1);
-               }
-       for (i = 0; i < NCACHED; i++)
-@@ -536,7 +536,7 @@
-       hashp = (HTAB *)dbp->internal;
-       if (flag) {
--              hashp->errno = errno = EINVAL;
-+              hashp->err = errno = EINVAL;
-               return (ERROR);
-       }
-       return (hash_access(hashp, HASH_GET, (DBT *)key, data));
-@@ -553,11 +553,11 @@
-       hashp = (HTAB *)dbp->internal;
-       if (flag && flag != R_NOOVERWRITE) {
--              hashp->errno = errno = EINVAL;
-+              hashp->err = errno = EINVAL;
-               return (ERROR);
-       }
-       if ((hashp->flags & O_ACCMODE) == O_RDONLY) {
--              hashp->errno = errno = EPERM;
-+              hashp->err = errno = EPERM;
-               return (ERROR);
-       }
-       return (hash_access(hashp, flag == R_NOOVERWRITE ?
-@@ -574,11 +574,11 @@
-       hashp = (HTAB *)dbp->internal;
-       if (flag && flag != R_CURSOR) {
--              hashp->errno = errno = EINVAL;
-+              hashp->err = errno = EINVAL;
-               return (ERROR);
-       }
-       if ((hashp->flags & O_ACCMODE) == O_RDONLY) {
--              hashp->errno = errno = EPERM;
-+              hashp->err = errno = EPERM;
-               return (ERROR);
-       }
-       return (hash_access(hashp, HASH_DELETE, (DBT *)key, NULL));
-@@ -729,7 +729,7 @@
-       hashp = (HTAB *)dbp->internal;
-       if (flag && flag != R_FIRST && flag != R_NEXT) {
--              hashp->errno = errno = EINVAL;
-+              hashp->err = errno = EINVAL;
-               return (ERROR);
-       }
- #ifdef HASH_STATISTICS
---- db.1.85/hash/ndbm.c        Mon Feb 18 19:12:58 2002
-+++ db.1.85/hash/ndbm.c        Mon Feb 18 19:13:05 2002
-@@ -180,7 +180,7 @@
-       HTAB *hp;
-       hp = (HTAB *)db->internal;
--      return (hp->errno);
-+      return (hp->err);
- }
- extern int
-@@ -190,7 +190,7 @@
-       HTAB *hp;
-       hp = (HTAB *)db->internal;
--      hp->errno = 0;
-+      hp->err = 0;
-       return (0);
- }
index 745f403..04a262b 100644 (file)
@@ -7,7 +7,6 @@ Version: 5.3.21
 Release: 11
 Source0: http://download.oracle.com/berkeley-db/db-%{version}.tar.gz
 # other patches
-Patch20: db-1.85-errno.patch
 Patch22: db-4.6.21-1.85-compat.patch
 Patch24: db-4.5.20-jni-include-dir.patch
 # License clarification patch
@@ -183,10 +182,6 @@ for building programs which use the Berkeley DB in Java.
 %prep
 %setup -q -n db-%{version}
 
-pushd db.1.85
-%patch20 -p1 -b .errno
-popd
-
 %patch22 -p1 -b .185compat
 %patch24 -p1 -b .4.5.20.jni
 %patch25 -p1 -b .licensefix