From: Hallvard Furuseth Date: Tue, 27 Nov 2012 22:56:47 +0000 (+0100) Subject: API change: mdb_drop() only accepts del=0 or 1. X-Git-Tag: OPENLDAP_REL_ENG_2_4_34~103^2~9 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7e620a34a28e200394dcf25839021c653449bd29;p=openldap API change: mdb_drop() only accepts del=0 or 1. This allows for other flag values in the future. --- diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index 4af54aa688..f7559b01a8 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -6904,7 +6904,7 @@ int mdb_drop(MDB_txn *txn, MDB_dbi dbi, int del) MDB_cursor *mc; int rc; - if (!txn || !dbi || dbi >= txn->mt_numdbs) + if (!txn || !dbi || dbi >= txn->mt_numdbs || (unsigned)del > 1) return EINVAL; if (F_ISSET(txn->mt_flags, MDB_TXN_RDONLY)) diff --git a/libraries/libmdb/mdb.h b/libraries/libmdb/mdb.h index bb0ca307bb..2fcf132c05 100644 --- a/libraries/libmdb/mdb.h +++ b/libraries/libmdb/mdb.h @@ -792,12 +792,12 @@ void mdb_close(MDB_env *env, MDB_dbi dbi); /** @brief Delete a database and/or free all its pages. * - * If the \b del parameter is non-zero the DB handle will be closed + * If the \b del parameter is 1, the DB handle will be closed * and the DB will be deleted. * @param[in] txn A transaction handle returned by #mdb_txn_begin() * @param[in] dbi A database handle returned by #mdb_open() - * @param[in] del non-zero to delete the DB from the environment, - * otherwise just free its pages. + * @param[in] del 1 to delete the DB from the environment, + * 0 to just free its pages. * @return A non-zero error value on failure and 0 on success. */ int mdb_drop(MDB_txn *txn, MDB_dbi dbi, int del);