From c15b10b8f7c793f68b76b242e8897d5a53b45446 Mon Sep 17 00:00:00 2001 From: "Eduardo Lima (Etrunko)" Date: Wed, 11 Dec 2013 11:27:46 -0200 Subject: [PATCH] db-1.85-errno.patch Signed-off-by: Eduardo Lima (Etrunko) --- db.1.85/hash/hash.c | 14 +++---- db.1.85/hash/hash.h | 2 +- db.1.85/hash/ndbm.c | 4 +- packaging/db-1.85-errno.patch | 89 ------------------------------------------- packaging/libdb.spec | 5 --- 5 files changed, 10 insertions(+), 104 deletions(-) delete mode 100644 packaging/db-1.85-errno.patch diff --git a/db.1.85/hash/hash.c b/db.1.85/hash/hash.c index 4b7b732..af654ac 100644 --- a/db.1.85/hash/hash.c +++ b/db.1.85/hash/hash.c @@ -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 diff --git a/db.1.85/hash/hash.h b/db.1.85/hash/hash.h index 913e82b..fe84d32 100644 --- a/db.1.85/hash/hash.h +++ b/db.1.85/hash/hash.h @@ -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 */ diff --git a/db.1.85/hash/ndbm.c b/db.1.85/hash/ndbm.c index 2cbbe91..f2b7b69 100644 --- a/db.1.85/hash/ndbm.c +++ b/db.1.85/hash/ndbm.c @@ -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 index ccc9ddf..0000000 --- a/packaging/db-1.85-errno.patch +++ /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); - } - diff --git a/packaging/libdb.spec b/packaging/libdb.spec index 745f403..04a262b 100644 --- a/packaging/libdb.spec +++ b/packaging/libdb.spec @@ -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 -- 2.7.4