]> git.sur5r.net Git - openldap/commitdiff
ITS#4143 bdb_tool_info should only be non-NULL for QUICK index/add
authorHoward Chu <hyc@openldap.org>
Fri, 4 Nov 2005 02:52:14 +0000 (02:52 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 4 Nov 2005 02:52:14 +0000 (02:52 +0000)
servers/slapd/back-bdb/tools.c

index d3701e15931dfdeb774c5c0a8c35e389ada5a73d..9dbb549afcf68ca3c8db22b67835d36fa9cc6f3b 100644 (file)
@@ -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 ));