From: Hallvard Furuseth Date: Sun, 19 Jul 2015 19:18:31 +0000 (+0200) Subject: ITS#8200 Fix mdb_midl_shrink() usage, return void X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=90f6fc4ba7d60f602acd1ef63e4c7d939fb514e1;p=openldap ITS#8200 Fix mdb_midl_shrink() usage, return void --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 83ea5e474b..a2a68a1641 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -2947,8 +2947,8 @@ mdb_txn_reset0(MDB_txn *txn, const char *act) } if (!txn->mt_parent) { - if (mdb_midl_shrink(&txn->mt_free_pgs)) - env->me_free_pgs = txn->mt_free_pgs; + mdb_midl_shrink(&txn->mt_free_pgs); + env->me_free_pgs = txn->mt_free_pgs; /* me_pgstate: */ env->me_pghead = NULL; env->me_pglast = 0; @@ -3533,8 +3533,8 @@ mdb_txn_commit(MDB_txn *txn) mdb_midl_free(env->me_pghead); env->me_pghead = NULL; - if (mdb_midl_shrink(&txn->mt_free_pgs)) - env->me_free_pgs = txn->mt_free_pgs; + mdb_midl_shrink(&txn->mt_free_pgs); + env->me_free_pgs = txn->mt_free_pgs; #if (MDB_DEBUG) > 2 mdb_audit(txn); diff --git a/libraries/liblmdb/midl.c b/libraries/liblmdb/midl.c index 16782dcafc..57a9d4920e 100644 --- a/libraries/liblmdb/midl.c +++ b/libraries/liblmdb/midl.c @@ -116,7 +116,7 @@ void mdb_midl_free(MDB_IDL ids) free(ids-1); } -int mdb_midl_shrink( MDB_IDL *idp ) +void mdb_midl_shrink( MDB_IDL *idp ) { MDB_IDL ids = *idp; if (*(--ids) > MDB_IDL_UM_MAX && @@ -124,9 +124,7 @@ int mdb_midl_shrink( MDB_IDL *idp ) { *ids++ = MDB_IDL_UM_MAX; *idp = ids; - return 1; } - return 0; } static int mdb_midl_grow( MDB_IDL *idp, int num ) diff --git a/libraries/liblmdb/midl.h b/libraries/liblmdb/midl.h index 9b041d72d1..2331e78398 100644 --- a/libraries/liblmdb/midl.h +++ b/libraries/liblmdb/midl.h @@ -98,9 +98,8 @@ void mdb_midl_free(MDB_IDL ids); /** Shrink an IDL. * Return the IDL to the default size if it has grown larger. * @param[in,out] idp Address of the IDL to shrink. - * @return 0 on no change, non-zero if shrunk. */ -int mdb_midl_shrink(MDB_IDL *idp); +void mdb_midl_shrink(MDB_IDL *idp); /** Make room for num additional elements in an IDL. * @param[in,out] idp Address of the IDL.