mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-22 14:53:33 -05:00
Move BDB backend initialization to bdb_open. bdb_initialize()
shouldn't do much more than register callbacks.
This commit is contained in:
parent
7c60cde35d
commit
4554557171
1 changed files with 42 additions and 43 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue