X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-bdb%2Fnextid.c;h=f5d0e618b17508df03e4b6e47f82f37fcc9da5df;hb=02fb60d3dad11f9ee46feb6ba3eb9ad96dde0c48;hp=5f2b6e30a5cc9a95eb4491244b50c6793dd7a9b5;hpb=b45133c9580a692ebeb8bd81552a60ba406e0f24;p=openldap diff --git a/servers/slapd/back-bdb/nextid.c b/servers/slapd/back-bdb/nextid.c index 5f2b6e30a5..f5d0e618b1 100644 --- a/servers/slapd/back-bdb/nextid.c +++ b/servers/slapd/back-bdb/nextid.c @@ -1,7 +1,7 @@ /* init.c - initialize bdb backend */ /* $OpenLDAP$ */ /* - * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. + * Copyright 1998-2002 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,15 @@ int bdb_last_id( BackendDB *be, DB_TXN *tid ) break; default: +#ifdef NEW_LOGGING + LDAP_LOG (( "nextid", LDAP_LEVEL_ERR, + "bdb_last_id: get failed: %s (%d)\n", + db_strerror(rc), rc )); +#else Debug( LDAP_DEBUG_ANY, "=> bdb_last_id: get failed: %s (%d)\n", db_strerror(rc), rc, 0 ); +#endif goto done; }