} \
} while ( 0 )
-static int
+int
bdb_idl_entry_cmp( const void *v_idl1, const void *v_idl2 )
{
const bdb_idl_cache_entry_t *idl1 = v_idl1, *idl2 = v_idl2;
int i = 0;
while ( bdb->bi_idl_lru_tail != NULL && i < 10 ) {
ee = bdb->bi_idl_lru_tail;
- avl_delete( &bdb->bi_idl_tree, (caddr_t) ee,
- bdb_idl_entry_cmp );
+ if ( avl_delete( &bdb->bi_idl_tree, (caddr_t) ee,
+ bdb_idl_entry_cmp ) == NULL ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( INDEX, ERR,
+ "bdb_idl_fetch_key: AVL delete failed\n",
+ 0, 0, 0 );
+#else
+ Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: "
+ "AVL delete failed\n",
+ 0, 0, 0 );
+#endif
+ }
IDL_LRU_DELETE( bdb, ee );
i++;
--bdb->bi_idl_cache_size;
matched_idl_entry = avl_find( bdb->bi_idl_tree, &idl_tmp,
bdb_idl_entry_cmp );
if ( matched_idl_entry != NULL ) {
- avl_delete( &bdb->bi_idl_tree, (caddr_t) matched_idl_entry,
- bdb_idl_entry_cmp );
+ if ( avl_delete( &bdb->bi_idl_tree, (caddr_t) matched_idl_entry,
+ bdb_idl_entry_cmp ) == NULL ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( INDEX, ERR,
+ "bdb_idl_fetch_key: AVL delete failed\n",
+ 0, 0, 0 );
+#else
+ Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: "
+ "AVL delete failed\n",
+ 0, 0, 0 );
+#endif
+ }
--bdb->bi_idl_cache_size;
IDL_LRU_DELETE( bdb, matched_idl_entry );
free( matched_idl_entry->kstr.bv_val );
matched_idl_entry = avl_find( bdb->bi_idl_tree, &idl_tmp,
bdb_idl_entry_cmp );
if ( matched_idl_entry != NULL ) {
- avl_delete( &bdb->bi_idl_tree, (caddr_t) matched_idl_entry,
- bdb_idl_entry_cmp );
+ if ( avl_delete( &bdb->bi_idl_tree, (caddr_t) matched_idl_entry,
+ bdb_idl_entry_cmp ) == NULL ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( INDEX, ERR,
+ "bdb_idl_fetch_key: AVL delete failed\n",
+ 0, 0, 0 );
+#else
+ Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: "
+ "AVL delete failed\n",
+ 0, 0, 0 );
+#endif
+ }
--bdb->bi_idl_cache_size;
IDL_LRU_DELETE( bdb, matched_idl_entry );
free( matched_idl_entry->kstr.bv_val );