From e472ed00e2a3710a33e4cbd1eaaa403b1617e00c Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 6 Dec 2004 21:25:16 +0000 Subject: [PATCH] Fix inequality cursor management --- servers/slapd/back-bdb/idl.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/servers/slapd/back-bdb/idl.c b/servers/slapd/back-bdb/idl.c index f190b5ef44..7fcc6a0abb 100644 --- a/servers/slapd/back-bdb/idl.c +++ b/servers/slapd/back-bdb/idl.c @@ -478,14 +478,15 @@ bdb_idl_fetch_key( if ( tid ) flags |= DB_RMW; /* If we're not reusing an existing cursor, get a new one */ - if( opflag != DB_NEXT ) + if( opflag != DB_NEXT ) { rc = db->cursor( db, tid, &cursor, bdb->bi_db_opflags ); - else + if( rc != 0 ) { + Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: " + "cursor failed: %s (%d)\n", db_strerror(rc), rc, 0 ); + return rc; + } + } else { cursor = *saved_cursor; - if( rc != 0 ) { - Debug( LDAP_DEBUG_ANY, "=> bdb_idl_fetch_key: " - "cursor failed: %s (%d)\n", db_strerror(rc), rc, 0 ); - return rc; } /* If this is a LE lookup, save original key so we can determine -- 2.39.5