Patch so this works correctly with db4 4.1 now

This commit is contained in:
jmc 2003-06-16 16:54:03 +00:00
parent bff8e49ca0
commit 91387f952f
2 changed files with 38 additions and 1 deletions

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.2 2003/03/02 12:10:46 jmmv Exp $
$NetBSD: distinfo,v 1.3 2003/06/16 16:54:03 jmc Exp $
SHA1 (prayer-1.0.5.tar.gz) = 56ab33aab2c1960a28bb59f076869b4ebc4c5f4f
Size (prayer-1.0.5.tar.gz) = 500762 bytes
@ -7,3 +7,4 @@ SHA1 (patch-ab) = 015dac1b72153c394666e2389339609b3dd9fcb5
SHA1 (patch-ac) = fc5bf9ed2c250dcf790c29379dc8405a27eacefd
SHA1 (patch-ad) = b7501587b937767304b8bbe2d84f01663e5d74ad
SHA1 (patch-ae) = 46ec78e0b7c777db16b187ca012f194638f7855a
SHA1 (patch-af) = e897f2fd7413372e3c701745d28c8b54cf45c06d

View file

@ -0,0 +1,36 @@
$NetBSD: patch-af,v 1.1 2003/06/16 16:54:32 jmc Exp $
--- mydb_db3.c.orig Mon Jun 16 11:16:13 2003
+++ mydb_db3.c Mon Jun 16 11:24:26 2003
@@ -239,13 +239,18 @@
assert(dbinit);
+/* DB4.1 doesn't use DB_INCOMPLETE anymore */
+#if !((DB_VERSION_MAJOR == 4) && (DB_VERSION_MINOR >= 1))
do {
+#endif
#if (DB_VERSION_MAJOR > 3) || ((DB_VERSION_MAJOR == 3) && (DB_VERSION_MINOR > 0))
r = txn_checkpoint(dbenv, 0, 0, 0);
#else
r = txn_checkpoint(dbenv, 0, 0);
#endif
+#if !((DB_VERSION_MAJOR == 4) && (DB_VERSION_MINOR >= 1))
} while (r == DB_INCOMPLETE);
+#endif
if (r) {
syslog(LOG_ERR, "DBERROR: couldn't checkpoint: %s",
db_strerror(r));
@@ -354,7 +359,12 @@
}
/* xxx set comparator! */
+ /* 4.1 supports transactions and changed the open() syntax */
+#if ((DB_VERSION_MAJOR == 4) && (DB_VERSION_MINOR >= 1))
+ r = db->open(db, NULL, fname, NULL, DB_BTREE, DB_CREATE, 0664);
+#else
r = db->open(db, fname, NULL, DB_BTREE, DB_CREATE, 0664);
+#endif
if (r != 0) {
syslog(LOG_ERR, "DBERROR: opening %s: %s", fname, db_strerror(r));
return MYDB_IOERROR;