Skip to content
Snippets Groups Projects
Commit 45545571 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Move BDB backend initialization to bdb_open. bdb_initialize()

shouldn't do much more than register callbacks.
parent 7c60cde3
Branches
Tags
No related merge requests found
......@@ -30,20 +30,54 @@ static struct bdbi_database {
{ NULL, NULL, 0, 0 }
};
#if 0
static int
bdb_destroy( BackendInfo *bi )
{
return 0;
}
static int
bdb_open( BackendInfo *bi )
{
static char *controls[] = {
LDAP_CONTROL_MANAGEDSAIT,
LDAP_CONTROL_SUBENTRIES,
LDAP_CONTROL_NOOP,
NULL
};
/* initialize the underlying database system */
Debug( LDAP_DEBUG_TRACE, "bdb_open: initialize BDB backend\n",
0, 0, 0 );
{ /* version check */
int major, minor, patch;
char *version = db_version( &major, &minor, &patch );
if( major != DB_VERSION_MAJOR ||
minor != DB_VERSION_MINOR ||
patch < DB_VERSION_PATCH )
{
Debug( LDAP_DEBUG_ANY,
"bdb_open: version mismatch\n"
"\texpected: " DB_VERSION_STRING "\n"
"\tgot: %s \n", version, 0, 0 );
}
Debug( LDAP_DEBUG_ANY, "bdb_open: %s\n",
version, 0, 0 );
}
#if 0
db_env_set_func_malloc( ch_malloc );
db_env_set_func_realloc( ch_realloc );
db_env_set_func_free( ch_free );
#endif
db_env_set_func_yield( ldap_pvt_thread_yield );
bi->bi_controls = controls;
return 0;
}
#if 0
static int
bdb_destroy( BackendInfo *bi )
{
return 0;
}
......@@ -403,42 +437,7 @@ bdb_initialize(
BackendInfo *bi
)
{
static char *controls[] = {
LDAP_CONTROL_MANAGEDSAIT,
LDAP_CONTROL_SUBENTRIES,
LDAP_CONTROL_NOOP,
NULL
};
{ /* version check */
int major, minor, patch;
char *version = db_version( &major, &minor, &patch );
if( major != DB_VERSION_MAJOR ||
minor != DB_VERSION_MINOR ||
patch < DB_VERSION_PATCH )
{
Debug( LDAP_DEBUG_ANY,
"bi_back_initialize: version mismatch\n"
"\texpected: " DB_VERSION_STRING "\n"
"\tgot: %s \n", version, 0, 0 );
}
Debug( LDAP_DEBUG_ANY, "bdb_initialize: %s\n",
version, 0, 0 );
}
#if 0
db_env_set_func_malloc( ch_malloc );
db_env_set_func_realloc( ch_realloc );
db_env_set_func_free( ch_free );
#endif
db_env_set_func_yield( ldap_pvt_thread_yield );
bi->bi_controls = controls;
bi->bi_open = 0;
bi->bi_open = bdb_open;
bi->bi_close = 0;
bi->bi_config = 0;
bi->bi_destroy = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment