Blob Blame Raw
--- cyrus-imapd-2.3.7/cmulocal/berkdb.m4.db4.5	2006-05-23 15:27:15.000000000 +0200
+++ cyrus-imapd-2.3.7/cmulocal/berkdb.m4	2007-01-08 11:57:05.000000000 +0100
@@ -213,7 +213,7 @@
 	fi
 
 	saved_LIBS=$LIBS
-        for dbname in db-4.4 db4.4 db44 db-4.3 db4.3 db43 db-4.2 db4.2 db42 db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db-3.3 db3.3 db33 db-3.2 db3.2 db32 db-3.1 db3.1 db31 db-3 db30 db3 db
+        for dbname in db-4.5 db4.5 db45 db-4.4 db4.4 db44 db-4.3 db4.3 db43 db-4.2 db4.2 db42 db-4.1 db4.1 db41 db-4.0 db4.0 db-4 db40 db4 db-3.3 db3.3 db33 db-3.2 db3.2 db32 db-3.1 db3.1 db31 db-3 db30 db3 db
           do
 	    LIBS="$saved_LIBS -l$dbname"
 	    AC_TRY_LINK([#include <db.h>],
--- cyrus-imapd-2.3.7/lib/cyrusdb_berkeley.c.db4.5	2006-02-28 13:58:07.000000000 +0100
+++ cyrus-imapd-2.3.7/lib/cyrusdb_berkeley.c	2007-01-08 12:00:29.000000000 +0100
@@ -173,7 +173,15 @@
 	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));