summaryrefslogtreecommitdiff
path: root/lib/mu_dbm.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2006-04-19 13:27:53 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2006-04-19 13:27:53 +0000
commitfc26d92d2fec6139f1b96dc3fec750e7b507e812 (patch)
tree1f54916dbecee74c8412a93db7852fb831d509d2 /lib/mu_dbm.c
parent30f5f2ac2bfd4312968ebea9f24bcb8e900afb4f (diff)
downloadmailutils-fc26d92d2fec6139f1b96dc3fec750e7b507e812.tar.gz
mailutils-fc26d92d2fec6139f1b96dc3fec750e7b507e812.tar.bz2
Add support for Berkeley DB >= 3
Diffstat (limited to 'lib/mu_dbm.c')
-rw-r--r--lib/mu_dbm.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/mu_dbm.c b/lib/mu_dbm.c
index 089ddfe31..a03e9c007 100644
--- a/lib/mu_dbm.c
+++ b/lib/mu_dbm.c
@@ -1,5 +1,5 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2006 Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -197,7 +197,7 @@ mu_dbm_nextkey (DBM_FILE db, DBM_DATUM key)
return gdbm_nextkey (db, key);
}
-#elif defined(WITH_BDB2)
+#elif defined(WITH_BDB)
#define DB_SUFFIX ".db"
@@ -241,7 +241,15 @@ mu_dbm_open (char *name, DBM_FILE *dbm, int flags, int mode)
return -1;
}
+#if WITH_BDB == 2
rc = db_open (pfname, DB_HASH, f, mode, NULL, NULL, &db);
+#else
+ rc = db_create (&db, NULL, 0);
+ if (rc != 0 || db == NULL)
+ return rc;
+ rc = db->open (db, pfname, NULL, DB_HASH, f, mode);
+#endif
+
free (pfname);
if (rc)
return -1;

Return to:

Send suggestions and report system problems to the System administrator.