Mika Iisakkila wrote:
> ...so I suppose something in lib/cyrusdb_db3.c still isn't quite
> compatible with BDB 4.1. I get this same error in Linux and HP-UX 11.11,
> so I suppose it's general and not a compilation screwup. Any
> off-the-shelf ideas on how to fix this, before I plunge into the source
> myself?

Sorry, my bad -- the patch I submitted wasn't enough for actually
running with db 4.1, although it compiled fine. Delivery database is
transactional and I overlooked that. One additional flag was
required for db->open().

The attached patch should work against imapd-2.1.9.

--mika

diff -cr cyrus-imapd-2.1.9/lib/cyrusdb_db3.c 
/home/mika/src/cyrus-imapd-2.1.9/lib/cyrusdb_db3.c
*** cyrus-imapd-2.1.9/lib/cyrusdb_db3.c Tue Aug  6 19:55:03 2002
--- /home/mika/src/cyrus-imapd-2.1.9/lib/cyrusdb_db3.c  Thu Oct 17 15:45:07 2002
***************
*** 232,244 ****
--- 232,248 ----
  
      assert(dbinit);
  
+ #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));
***************
*** 347,353 ****
--- 351,361 ----
      }
      /* xxx set comparator! */
  
+ #if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1
+     r = db->open(db, NULL, fname, NULL, DB_BTREE, DB_CREATE | DB_AUTO_COMMIT, 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 CYRUSDB_IOERROR;

Reply via email to