]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/nextid.c
Cancel exop updates
[openldap] / servers / slapd / back-bdb / nextid.c
index 5f2b6e30a5cc9a95eb4491244b50c6793dd7a9b5..04b2f267ccb174f34fd0e7bc83fd74d0f570bedb 100644 (file)
@@ -1,7 +1,7 @@
 /* init.c - initialize bdb backend */
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
@@ -43,12 +43,9 @@ int bdb_last_id( BackendDB *be, DB_TXN *tid )
        rc = bdb->bi_id2entry->bdi_db->cursor( bdb->bi_id2entry->bdi_db,
                tid, &cursor, 0 );
 
-       while (rc == 0) {
+       if (rc == 0) {
                rc = cursor->c_get(cursor, &key, &data, DB_LAST);
                cursor->c_close(cursor);
-               if (rc != 0)
-                       break;
-               break;
        }
 
        switch(rc) {
@@ -60,9 +57,14 @@ int bdb_last_id( BackendDB *be, DB_TXN *tid )
                break;
 
        default:
+#ifdef NEW_LOGGING
+               LDAP_LOG ( INDEX, ERR, "bdb_last_id: get failed: %s (%d)\n",
+                       db_strerror(rc), rc, 0 );
+#else
                Debug( LDAP_DEBUG_ANY,
                        "=> bdb_last_id: get failed: %s (%d)\n",
                        db_strerror(rc), rc, 0 );
+#endif
                goto done;
        }