]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/tools.c
Ditch LRU cache replacement in favor of 2nd-chance/clock.
[openldap] / servers / slapd / back-bdb / tools.c
index 604471c57aa4bb700a44aa349ed04506b426987d..f3830331c6f199f73251a03caefc269958b287c0 100644 (file)
@@ -273,7 +273,7 @@ Entry* bdb_tool_entry_get( BackendDB *be, ID id )
        data.flags ^= DB_DBT_PARTIAL;
        data.ulen = 0;
     rc = cursor->c_get( cursor, &key, &data, DB_CURRENT );
-       if ( rc != ENOMEM ) goto leave;
+       if ( rc != DB_BUFFER_SMALL ) goto leave;
 
        /* Allocate a block and retrieve the data */
        eh.bv.bv_len = eh.nvals * sizeof( struct berval ) + data.size;
@@ -286,6 +286,7 @@ Entry* bdb_tool_entry_get( BackendDB *be, ID id )
        eh.data += eoff;
 
     rc = cursor->c_get( cursor, &key, &data, DB_CURRENT );
+       if ( rc ) goto leave;
 
 #ifdef SLAP_ZONE_ALLOC
        /* FIXME: will add ctx later */
@@ -423,6 +424,9 @@ bdb_tool_index_add(
 {
        struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private;
 
+       if ( !bdb->bi_nattrs )
+               return 0;
+
        if ( slapMode & SLAP_TOOL_QUICK ) {
                IndexRec *ir;
                int i, rc;