Skip to content
Snippets Groups Projects
Commit 3b9f4a82 authored by Howard Chu's avatar Howard Chu
Browse files

Added support for BDB 4.1.17

parent 3a15afa0
No related branches found
No related tags found
No related merge requests found
......@@ -335,7 +335,11 @@ ldbm_open( DB_ENV *env, char *name, int rw, int mode, int dbcachesize )
__atoe(n2);
name = n2;
#endif
#if DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR > 0 && DB_VERSION_PATCH >= 17
err = ret->open( ret, NULL, name, NULL, DB_TYPE, rw, mode);
#else
err = ret->open( ret, name, NULL, DB_TYPE, rw, mode);
#endif
if ( err != 0 ) {
int tmp = errno;
......
......@@ -143,6 +143,9 @@ struct bdb_op_info {
int boi_err;
};
#define DB_OPEN(db, file, name, type, flags, mode) \
(db)->open(db, file, name, type, flags, mode)
#if DB_VERSION_MAJOR < 4
#define LOCK_DETECT(env,f,t,a) lock_detect(env, f, t, a)
#define LOCK_GET(env,i,f,o,m,l) lock_get(env, i, f, o, m, l)
......@@ -167,6 +170,13 @@ struct bdb_op_info {
#define TXN_ID(txn) (txn)->id(txn)
#define LOCK_ID(env, locker) (env)->lock_id(env, locker)
#define LOCK_ID_FREE(env, locker) (env)->lock_id_free(env, locker)
#if DB_VERSION_MINOR > 1 || DB_VERSION_PATCH >= 17
#undef DB_OPEN
#define DB_OPEN(db, file, name, type, flags, mode) \
(db)->open(db, NULL, file, name, type, (flags)|DB_AUTO_COMMIT, mode)
#endif
#endif
LDAP_END_DECL
......
......@@ -109,7 +109,7 @@ bdb_db_cache(
file = ch_malloc( strlen( name ) + sizeof(BDB_SUFFIX) );
sprintf( file, "%s" BDB_SUFFIX, name );
rc = db->bdi_db->open( db->bdi_db,
rc = DB_OPEN( db->bdi_db,
file, name,
DB_HASH, bdb->bi_db_opflags | DB_CREATE | DB_THREAD,
bdb->bi_dbenv_mode );
......
......@@ -362,7 +362,7 @@ bdb_db_open( BackendDB *be )
BDB_PAGESIZE );
}
rc = db->bdi_db->open( db->bdi_db,
rc = DB_OPEN( db->bdi_db,
bdbi_databases[i].file,
/* bdbi_databases[i].name, */ NULL,
bdbi_databases[i].type,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment