ITS#4143 bdb_tool_info should only be non-NULL for QUICK index/add

This commit is contained in:
Howard Chu 2005-11-04 02:52:14 +00:00
parent d170fae411
commit 8f7fbfe60a

View File

@ -93,10 +93,10 @@ int bdb_tool_entry_open(
} }
} }
/* Set up for slapindex */ /* Set up for threaded slapindex */
if ( !(slapMode & SLAP_TOOL_READONLY )) { if (( slapMode & (SLAP_TOOL_QUICK|SLAP_TOOL_READONLY)) == SLAP_TOOL_QUICK) {
int i; if ( !bdb_tool_info ) {
if ( !bdb_tool_info && ( slapMode & SLAP_TOOL_QUICK )) { int i;
ldap_pvt_thread_mutex_init( &bdb_tool_index_mutex ); ldap_pvt_thread_mutex_init( &bdb_tool_index_mutex );
ldap_pvt_thread_cond_init( &bdb_tool_index_cond ); ldap_pvt_thread_cond_init( &bdb_tool_index_cond );
bdb_tool_index_threads = ch_malloc( slap_tool_thread_max * sizeof( int )); bdb_tool_index_threads = ch_malloc( slap_tool_thread_max * sizeof( int ));