X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-mdb%2Fnextid.c;h=d4ce5e34a3276a34a996f510b766767e2b79fc35;hb=fc1396fa2e94ee2e752fd7c3ea5bb22f6592398a;hp=1d7b3893cb0d3c431154a5cea08cb866ee943eb4;hpb=7164c4c66215da39f03e353a9c72eba408abddbf;p=openldap diff --git a/servers/slapd/back-mdb/nextid.c b/servers/slapd/back-mdb/nextid.c index 1d7b3893cb..d4ce5e34a3 100644 --- a/servers/slapd/back-mdb/nextid.c +++ b/servers/slapd/back-mdb/nextid.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 2000-2011 The OpenLDAP Foundation. + * Copyright 2000-2012 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -21,21 +21,13 @@ #include "back-mdb.h" -int mdb_next_id( BackendDB *be, MDB_txn *tid, ID *out ) +int mdb_next_id( BackendDB *be, MDB_cursor *mc, ID *out ) { - struct mdb_info *mdb = (struct mdb_info *) be->be_private; int rc; ID id = 0; MDB_val key; - MDB_cursor *cursor; - /* Get a read cursor */ - rc = mdb_cursor_open( tid, mdb->mi_id2entry, &cursor ); - - if (rc == 0) { - rc = mdb_cursor_get(cursor, &key, NULL, MDB_LAST); - mdb_cursor_close(cursor); - } + rc = mdb_cursor_get(mc, &key, NULL, MDB_LAST); switch(rc) { case MDB_NOTFOUND: