From: Howard Chu Date: Thu, 11 Jul 2013 20:09:46 +0000 (+0200) Subject: Factor out parent X-Git-Tag: OPENLDAP_REL_ENG_2_4_36~32^2~20 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=87a7f06feb795ee50325c74ed02844ecfde5270c;p=openldap Factor out parent --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index b186ba7411..bf1be8559b 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -2348,16 +2348,16 @@ mdb_txn_commit(MDB_txn *txn) /* Update parent's DB table. */ memcpy(parent->mt_dbs, txn->mt_dbs, txn->mt_numdbs * sizeof(MDB_db)); - txn->mt_parent->mt_numdbs = txn->mt_numdbs; - txn->mt_parent->mt_dbflags[0] = txn->mt_dbflags[0]; - txn->mt_parent->mt_dbflags[1] = txn->mt_dbflags[1]; + parent->mt_numdbs = txn->mt_numdbs; + parent->mt_dbflags[0] = txn->mt_dbflags[0]; + parent->mt_dbflags[1] = txn->mt_dbflags[1]; for (i=2; imt_numdbs; i++) { /* preserve parent's DB_NEW status */ - x = txn->mt_parent->mt_dbflags[i] & DB_NEW; - txn->mt_parent->mt_dbflags[i] = txn->mt_dbflags[i] | x; + x = parent->mt_dbflags[i] & DB_NEW; + parent->mt_dbflags[i] = txn->mt_dbflags[i] | x; } - dst = txn->mt_parent->mt_u.dirty_list; + dst = parent->mt_u.dirty_list; src = txn->mt_u.dirty_list; /* Find len = length of merging our dirty list with parent's */ x = dst[0].mid; @@ -2391,7 +2391,7 @@ mdb_txn_commit(MDB_txn *txn) free(txn->mt_u.dirty_list); parent->mt_dirty_room = txn->mt_dirty_room; - txn->mt_parent->mt_child = NULL; + parent->mt_child = NULL; mdb_midl_free(((MDB_ntxn *)txn)->mnt_pgstate.mf_pghead); free(txn); return MDB_SUCCESS;