From: Hallvard Furuseth Date: Wed, 11 Dec 2013 10:57:13 +0000 (+0100) Subject: Fix mdb_reader_list() and its spec. X-Git-Tag: accepted/tizen/5.0/unified/20181102.030725~474 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7e453c97632599a420824c06458353f2a18242aa;p=platform%2Fupstream%2Flmdb.git 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 4800b6e..ff82017 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 ab77360..fbffdd6 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