# HG changeset patch # User stephent # Date 1039010085 0 # Node ID 0dade3314f4fbee01f49afd1de5f16fc0e1d2b27 # Parent db9bfcf5e0548f81bdfd9723828df87bef910c43 [xemacs-hg @ 2002-12-04 13:54:31 by stephent] BerkDB 4 <871y4xnb90.fsf@tleepslib.sk.tsukuba.ac.jp> diff -r db9bfcf5e054 -r 0dade3314f4f src/ChangeLog --- 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 + + * 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 * frame.c (frame_conversion_internal): Convert pixel_to_char diff -r db9bfcf5e054 -r 0dade3314f4f src/database.c --- 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);