summaryrefslogtreecommitdiff
path: root/mail/prayer/patches/patch-af
blob: 25754464d5fa106d08e9364aa7c540581037a663 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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;