From b9130d3d6325e0e4cc4fcb11bb266368652d4f80 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 31 Oct 2015 02:27:31 +0000 Subject: [PATCH] Use MDB_USE_ROBUST not MDB_NO_ROBUST --- libraries/liblmdb/Makefile | 2 +- libraries/liblmdb/mdb.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libraries/liblmdb/Makefile b/libraries/liblmdb/Makefile index e8e55e6..2c3817f 100644 --- a/libraries/liblmdb/Makefile +++ b/libraries/liblmdb/Makefile @@ -13,7 +13,7 @@ # - MDB_FDATASYNC # - MDB_FDATASYNC_WORKS # - MDB_USE_PWRITEV -# - MDB_NO_ROBUST +# - MDB_USE_ROBUST # # There may be other macros in mdb.c of interest. You should # read mdb.c before changing any of them. diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 80b914b..1e5c000 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -252,25 +252,25 @@ union semun { #define MDB_OWNERDEAD EOWNERDEAD /**< #LOCK_MUTEX0() result if dead owner */ #endif -/* Android currently lacks Robust Mutex support */ -#if defined(ANDROID) && defined(MDB_USE_POSIX_MUTEX) -#define MDB_NO_ROBUST 1 -#endif /** Some platforms define the EOWNERDEAD error code * even though they don't support Robust Mutexes. - * Compile with -DMDB_NO_ROBUST, or use some other + * Compile with -DMDB_USE_ROBUST=0, or use some other * mechanism like -DMDB_USE_SYSV_SEM instead of * -DMDB_USE_POSIX_MUTEX. (SysV semaphores are * also Robust, but some systems don't support them * either.) */ - -#ifndef MDB_NO_ROBUST -#define MDB_NO_ROBUST 0 +#ifndef MDB_USE_ROBUST +/* Android currently lacks Robust Mutex support */ +#if defined(ANDROID) && defined(MDB_USE_POSIX_MUTEX) && !defined(MDB_USE_ROBUST) +#define MDB_USE_ROBUST 0 +#else +#define MDB_USE_ROBUST 1 #endif +#endif /* MDB_USE_ROBUST */ -#if defined(MDB_OWNERDEAD) && !(MDB_NO_ROBUST) +#if defined(MDB_OWNERDEAD) && MDB_USE_ROBUST #define MDB_ROBUST_SUPPORTED 1 #endif -- 2.7.4