From: Howard Chu Date: Fri, 4 Nov 2005 02:52:14 +0000 (+0000) Subject: ITS#4143 bdb_tool_info should only be non-NULL for QUICK index/add X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~103 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8f7fbfe60ac1918e1fd6eb2ceea9c20119e18a49;p=openldap ITS#4143 bdb_tool_info should only be non-NULL for QUICK index/add --- diff --git a/servers/slapd/back-bdb/tools.c b/servers/slapd/back-bdb/tools.c index d3701e1593..9dbb549afc 100644 --- a/servers/slapd/back-bdb/tools.c +++ b/servers/slapd/back-bdb/tools.c @@ -93,10 +93,10 @@ int bdb_tool_entry_open( } } - /* Set up for slapindex */ - if ( !(slapMode & SLAP_TOOL_READONLY )) { - int i; - if ( !bdb_tool_info && ( slapMode & SLAP_TOOL_QUICK )) { + /* Set up for threaded slapindex */ + if (( slapMode & (SLAP_TOOL_QUICK|SLAP_TOOL_READONLY)) == SLAP_TOOL_QUICK) { + if ( !bdb_tool_info ) { + int i; ldap_pvt_thread_mutex_init( &bdb_tool_index_mutex ); ldap_pvt_thread_cond_init( &bdb_tool_index_cond ); bdb_tool_index_threads = ch_malloc( slap_tool_thread_max * sizeof( int ));