From ad3f8367b0ef913dbff074ddd0fdcbcaa86fdbb0 Mon Sep 17 00:00:00 2001 From: NikoPLP Date: Thu, 1 Sep 2022 14:58:19 +0000 Subject: [PATCH 1/2] ITS#9910 fix undefined MDB_FDATASYNC on MacOSX Broken by d85fe32 ITS#9372 --- libraries/liblmdb/mdb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 5bdec70..c9c39b0 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -164,9 +164,10 @@ typedef SSIZE_T ssize_t; #if defined(__FreeBSD__) && defined(__FreeBSD_version) && __FreeBSD_version >= 1100110 # define MDB_USE_POSIX_MUTEX 1 # define MDB_USE_ROBUST 1 -#elif defined(__APPLE__) && !defined(MDB_USE_ROBUST) -# define MDB_USE_POSIX_SEM 1 #elif defined(__APPLE__) || defined (BSD) || defined(__FreeBSD_kernel__) +# if defined(__APPLE__) && !defined(MDB_USE_ROBUST) +# define MSB_USE_POSIX_SEM 1 +# endif # if !(defined(MDB_USE_POSIX_MUTEX) || defined(MDB_USE_POSIX_SEM)) # define MDB_USE_SYSV_SEM 1 # endif From 97e7e9ac795f77a1443cac2c534037dd7feb5dc5 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 21 Sep 2022 17:07:36 +0100 Subject: [PATCH 2/2] ITS#9524 fix loose page tracking Fixes commit 0e17ba43a818f6bdab7759586e247bae12692c25, loose pages that have been dropped from dirty list should no longer be counted. --- libraries/liblmdb/mdb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index c9c39b0..d4a2996 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -3717,7 +3717,6 @@ mdb_freelist_save(MDB_txn *txn) unsigned x; if ((rc = mdb_midl_need(&txn->mt_free_pgs, txn->mt_loose_count)) != 0) return rc; - lost_loose = txn->mt_loose_count; for (; mp; mp = NEXT_LOOSE_PAGE(mp)) { mdb_midl_xappend(txn->mt_free_pgs, mp->mp_pgno); /* must also remove from dirty list */