]> git.sur5r.net Git - openldap/commitdiff
Fix bogus error codes
authorHoward Chu <hyc@openldap.org>
Sat, 10 Sep 2011 02:53:56 +0000 (19:53 -0700)
committerHoward Chu <hyc@openldap.org>
Sat, 10 Sep 2011 02:53:56 +0000 (19:53 -0700)
servers/slapd/back-mdb/search.c
servers/slapd/back-mdb/tools.c

index 47b767a8642ac6b776a3858ab92c9efd1b1c2f3e..33d81fe764af291d386b95b5ed8910115387e296 100644 (file)
@@ -316,7 +316,7 @@ mdb_search( Operation *op, SlapReply *rs )
        rs->sr_err = mdb_cursor_open( ltid, mdb->mi_id2entry, &mci );
        if ( rs->sr_err ) {
                send_ldap_error( op, rs, LDAP_OTHER, "internal error" );
-               goto done;
+               return rs->sr_err;
        }
 
        if ( op->ors_deref & LDAP_DEREF_FINDING ) {
@@ -862,12 +862,14 @@ nochange:
        rs->sr_err = LDAP_SUCCESS;
 
 done:
+       if( isc.mc )
+               mdb_cursor_close( isc.mc );
+       if (mci)
+               mdb_cursor_close( mci );
        if ( moi == &opinfo ) {
                mdb_txn_reset( moi->moi_txn );
                LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
        }
-       if( isc.mc )
-               mdb_cursor_close( isc.mc );
        if( rs->sr_v2ref ) {
                ber_bvarray_free( rs->sr_v2ref );
                rs->sr_v2ref = NULL;
index 92130ab1a8f3f8da8d0a0b332c8a08baeda18a39..f1bd36a0169b5db6d2485dba23a3ce67f894ad87 100644 (file)
@@ -555,9 +555,7 @@ ID mdb_tool_entry_put(
        rc = mdb_tool_index_add( &op, txn, e );
        if( rc != 0 ) {
                snprintf( text->bv_val, text->bv_len,
-                               "index_entry_add failed: %s (%d)",
-                               rc == LDAP_OTHER ? "Internal error" :
-                               mdb_strerror(rc), rc );
+                               "index_entry_add failed: err=%d", rc );
                Debug( LDAP_DEBUG_ANY,
                        "=> " LDAP_XSTRING(mdb_tool_entry_put) ": %s\n",
                        text->bv_val, 0, 0 );
@@ -569,8 +567,7 @@ ID mdb_tool_entry_put(
        rc = mdb_id2entry_add( &op, txn, e );
        if( rc != 0 ) {
                snprintf( text->bv_val, text->bv_len,
-                               "id2entry_add failed: %s (%d)",
-                               mdb_strerror(rc), rc );
+                               "id2entry_add failed: err=%d", rc );
                Debug( LDAP_DEBUG_ANY,
                        "=> " LDAP_XSTRING(mdb_tool_entry_put) ": %s\n",
                        text->bv_val, 0, 0 );
@@ -734,8 +731,8 @@ done:
                mdb_txn_abort( txi );
                Debug( LDAP_DEBUG_ANY,
                        "=> " LDAP_XSTRING(mdb_tool_entry_reindex)
-                       ": txn_aborted! %s (%d)\n",
-                       mdb_strerror(rc), rc, 0 );
+                       ": txn_aborted! err=%d\n",
+                       rc, 0, 0 );
                e->e_id = NOID;
                txi = NULL;
        }
@@ -794,8 +791,7 @@ ID mdb_tool_entry_modify(
        rc = mdb_id2entry_update( &op, tid, e );
        if( rc != 0 ) {
                snprintf( text->bv_val, text->bv_len,
-                               "id2entry_add failed: %s (%d)",
-                               mdb_strerror(rc), rc );
+                               "id2entry_update failed: err=%d", rc );
                Debug( LDAP_DEBUG_ANY,
                        "=> " LDAP_XSTRING(mdb_tool_entry_modify) ": %s\n",
                        text->bv_val, 0, 0 );