From: Hallvard Furuseth Date: Wed, 11 Dec 2013 10:57:13 +0000 (+0100) Subject: Fix mdb_reader_list() and its spec. X-Git-Tag: OPENLDAP_REL_ENG_2_4_39~21^2~19 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7e453c97632599a420824c06458353f2a18242aa;p=openldap Fix mdb_reader_list() and its spec. It and the MDB_msg_func can now return >= 0 for success. Always return any MDB_msg_func() error result. --- diff --git a/libraries/liblmdb/lmdb.h b/libraries/liblmdb/lmdb.h index 4800b6e0f2..ff8201786c 100644 --- a/libraries/liblmdb/lmdb.h +++ b/libraries/liblmdb/lmdb.h @@ -1409,7 +1409,7 @@ int mdb_dcmp(MDB_txn *txn, MDB_dbi dbi, const MDB_val *a, const MDB_val *b); * * @param[in] msg The string to be printed. * @param[in] ctx An arbitrary context pointer for the callback. - * @return < 0 on failure, 0 on success. + * @return < 0 on failure, >= 0 on success. */ typedef int (MDB_msg_func)(const char *msg, void *ctx); @@ -1418,7 +1418,7 @@ typedef int (MDB_msg_func)(const char *msg, void *ctx); * @param[in] env An environment handle returned by #mdb_env_create() * @param[in] func A #MDB_msg_func function * @param[in] ctx Anything the message function needs - * @return < 0 on failure, 0 on success. + * @return < 0 on failure, >= 0 on success. */ int mdb_reader_list(MDB_env *env, MDB_msg_func *func, void *ctx); diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index ab77360042..fbffdd6e13 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -8299,7 +8299,7 @@ int mdb_reader_list(MDB_env *env, MDB_msg_func *func, void *ctx) unsigned int i, rdrs; MDB_reader *mr; char buf[64]; - int first = 1; + int rc = 0, first = 1; if (!env || !func) return -1; @@ -8311,7 +8311,6 @@ int mdb_reader_list(MDB_env *env, MDB_msg_func *func, void *ctx) for (i=0; i