aboutsummaryrefslogtreecommitdiff
path: root/mail/cyrus-imapd23/files/patch-lib::cyrusdb_berkeley.c
blob: 722b7bde206d6043cefc0225065cd0e831e8cd7c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Index: lib/cyrusdb_berkeley.c
diff -u -p lib/cyrusdb_berkeley.c.orig lib/cyrusdb_berkeley.c
--- lib/cyrusdb_berkeley.c.orig	2007-02-06 03:43:26.000000000 +0900
+++ lib/cyrusdb_berkeley.c	2007-08-06 23:04:15.000000000 +0900
@@ -176,7 +176,15 @@ static int init(const char *dbdir, int m
 	syslog(LOG_WARNING,
 	       "DBERROR: invalid berkeley_locks_max value, using internal default");
     } else {
+#if DB_VERSION_MAJOR >= 4
+	r = dbenv->set_lk_max_locks(dbenv, opt);
+	if (!r)
+	    r = dbenv->set_lk_max_lockers(dbenv, opt);
+	if (!r)
+	    r = dbenv->set_lk_max_objects(dbenv, opt);
+#else
 	r = dbenv->set_lk_max(dbenv, opt);
+#endif
 	if (r) {
 	    dbenv->err(dbenv, r, "set_lk_max");
 	    syslog(LOG_ERR, "DBERROR: set_lk_max(): %s", db_strerror(r));