Blame SOURCES/db-1.85-errno.patch

cb4edc
glibc doesn't like errno as the name of a field.
cb4edc
--- db.1.85/hash/hash.h	Mon Feb 18 19:12:14 2002
cb4edc
+++ db.1.85/hash/hash.h	Mon Feb 18 19:12:20 2002
cb4edc
@@ -103,7 +103,7 @@
cb4edc
 	BUFHEAD 	*cpage;		/* Current page */
cb4edc
 	int		cbucket;	/* Current bucket */
cb4edc
 	int		cndx;		/* Index of next item on cpage */
cb4edc
-	int		errno;		/* Error Number -- for DBM 
cb4edc
+	int		err;		/* Error Number -- for DBM 
cb4edc
 					 * compatability */
cb4edc
 	int		new_file;	/* Indicates if fd is backing store 
cb4edc
 					 * or no */
cb4edc
--- db.1.85/hash/hash.c	Mon Feb 18 19:12:24 2002
cb4edc
+++ db.1.85/hash/hash.c	Mon Feb 18 19:12:44 2002
cb4edc
@@ -505,7 +505,7 @@
cb4edc
 	else
cb4edc
 		if (wsize != sizeof(HASHHDR)) {
cb4edc
 			errno = EFTYPE;
cb4edc
-			hashp->errno = errno;
cb4edc
+			hashp->err = errno;
cb4edc
 			return (-1);
cb4edc
 		}
cb4edc
 	for (i = 0; i < NCACHED; i++)
cb4edc
@@ -536,7 +536,7 @@
cb4edc
 
cb4edc
 	hashp = (HTAB *)dbp->internal;
cb4edc
 	if (flag) {
cb4edc
-		hashp->errno = errno = EINVAL;
cb4edc
+		hashp->err = errno = EINVAL;
cb4edc
 		return (ERROR);
cb4edc
 	}
cb4edc
 	return (hash_access(hashp, HASH_GET, (DBT *)key, data));
cb4edc
@@ -553,11 +553,11 @@
cb4edc
 
cb4edc
 	hashp = (HTAB *)dbp->internal;
cb4edc
 	if (flag && flag != R_NOOVERWRITE) {
cb4edc
-		hashp->errno = errno = EINVAL;
cb4edc
+		hashp->err = errno = EINVAL;
cb4edc
 		return (ERROR);
cb4edc
 	}
cb4edc
 	if ((hashp->flags & O_ACCMODE) == O_RDONLY) {
cb4edc
-		hashp->errno = errno = EPERM;
cb4edc
+		hashp->err = errno = EPERM;
cb4edc
 		return (ERROR);
cb4edc
 	}
cb4edc
 	return (hash_access(hashp, flag == R_NOOVERWRITE ?
cb4edc
@@ -574,11 +574,11 @@
cb4edc
 
cb4edc
 	hashp = (HTAB *)dbp->internal;
cb4edc
 	if (flag && flag != R_CURSOR) {
cb4edc
-		hashp->errno = errno = EINVAL;
cb4edc
+		hashp->err = errno = EINVAL;
cb4edc
 		return (ERROR);
cb4edc
 	}
cb4edc
 	if ((hashp->flags & O_ACCMODE) == O_RDONLY) {
cb4edc
-		hashp->errno = errno = EPERM;
cb4edc
+		hashp->err = errno = EPERM;
cb4edc
 		return (ERROR);
cb4edc
 	}
cb4edc
 	return (hash_access(hashp, HASH_DELETE, (DBT *)key, NULL));
cb4edc
@@ -729,7 +729,7 @@
cb4edc
 
cb4edc
 	hashp = (HTAB *)dbp->internal;
cb4edc
 	if (flag && flag != R_FIRST && flag != R_NEXT) {
cb4edc
-		hashp->errno = errno = EINVAL;
cb4edc
+		hashp->err = errno = EINVAL;
cb4edc
 		return (ERROR);
cb4edc
 	}
cb4edc
 #ifdef HASH_STATISTICS
cb4edc
--- db.1.85/hash/ndbm.c	Mon Feb 18 19:12:58 2002
cb4edc
+++ db.1.85/hash/ndbm.c	Mon Feb 18 19:13:05 2002
cb4edc
@@ -180,7 +180,7 @@
cb4edc
 	HTAB *hp;
cb4edc
 
cb4edc
 	hp = (HTAB *)db->internal;
cb4edc
-	return (hp->errno);
cb4edc
+	return (hp->err);
cb4edc
 }
cb4edc
 
cb4edc
 extern int
cb4edc
@@ -190,7 +190,7 @@
cb4edc
 	HTAB *hp;
cb4edc
 
cb4edc
 	hp = (HTAB *)db->internal;
cb4edc
-	hp->errno = 0;
cb4edc
+	hp->err = 0;
cb4edc
 	return (0);
cb4edc
 }
cb4edc