changeset 1141:0dade3314f4f

[xemacs-hg @ 2002-12-04 13:54:31 by stephent] BerkDB 4 <871y4xnb90.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Wed, 04 Dec 2002 13:54:45 +0000
parents db9bfcf5e054
children 55834f418dfb
files src/ChangeLog src/database.c
diffstat 2 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Tue Dec 03 22:53:38 2002 +0000
+++ b/src/ChangeLog	Wed Dec 04 13:54:45 2002 +0000
@@ -1,3 +1,8 @@
+2002-12-02  Greg Allen  <greg_allen@westlb-systems.co.uk>
+
+	* database.c: Fix open_database. Berkeley DB API has changed in
+	4.1. see: http://www.sleepycat.com/docs/ref/upgrade.4.1/fop.html
+
 2002-11-25  Mike Sperber <mike@xemacs.org>
 
 	* frame.c (frame_conversion_internal): Convert pixel_to_char
--- a/src/database.c	Tue Dec 03 22:53:38 2002 +0000
+++ b/src/database.c	Wed Dec 04 13:54:45 2002 +0000
@@ -59,6 +59,9 @@
 #ifndef DB_VERSION_MAJOR
 # define DB_VERSION_MAJOR 1
 #endif /* DB_VERSION_MAJOR */
+#ifndef DB_VERSION_MINOR
+# define DB_VERSION_MINOR 0
+#endif /* DB_VERSION_MINOR */
 Lisp_Object Qberkeley_db;
 Lisp_Object Qhash, Qbtree, Qrecno, Qunknown;
 #if DB_VERSION_MAJOR > 2
@@ -715,8 +718,13 @@
       status = db_create (&dbase, NULL, 0);
       if (status)
         return Qnil;
+#if DB_VERSION_MAJOR < 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR < 1)
       status = dbase->open (dbase, filename, NULL,
                             real_subtype, accessmask, modemask);
+#else /* DB_VERSION >= 4.1 */
+      status = dbase->open (dbase, NULL, filename, NULL, real_subtype,
+			    accessmask | DB_AUTO_COMMIT, modemask);
+#endif /* DB_VERSION < 4.1 */
       if (status)
         {
           dbase->close (dbase, 0);