pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/databases/lmdb Backport a SunOS mutex fix from upstrea...
details: https://anonhg.NetBSD.org/pkgsrc/rev/d3baf4972d19
branches: trunk
changeset: 355207:d3baf4972d19
user: fhajny <fhajny%pkgsrc.org@localhost>
date: Fri Nov 25 15:50:13 2016 +0000
description:
Backport a SunOS mutex fix from upstream trunk. Bump PKGREVISION.
diffstat:
databases/lmdb/Makefile | 3 +-
databases/lmdb/distinfo | 5 +-
databases/lmdb/patches/patch-libraries_liblmdb_Makefile | 4 +-
databases/lmdb/patches/patch-libraries_liblmdb_mdb.c | 36 +++++++++++++++++
4 files changed, 42 insertions(+), 6 deletions(-)
diffs (81 lines):
diff -r a85bac76bdb3 -r d3baf4972d19 databases/lmdb/Makefile
--- a/databases/lmdb/Makefile Fri Nov 25 15:40:09 2016 +0000
+++ b/databases/lmdb/Makefile Fri Nov 25 15:50:13 2016 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.5 2016/02/16 12:16:28 mef Exp $
+# $NetBSD: Makefile,v 1.6 2016/11/25 15:50:13 fhajny Exp $
DISTNAME= LMDB-0.9.18
PKGNAME= ${DISTNAME:tl}
+PKGREVISION= 1
CATEGORIES= databases
MASTER_SITES= ${MASTER_SITE_GITHUB:=LMDB/}
diff -r a85bac76bdb3 -r d3baf4972d19 databases/lmdb/distinfo
--- a/databases/lmdb/distinfo Fri Nov 25 15:40:09 2016 +0000
+++ b/databases/lmdb/distinfo Fri Nov 25 15:50:13 2016 +0000
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.4 2016/02/16 12:16:28 mef Exp $
+$NetBSD: distinfo,v 1.5 2016/11/25 15:50:13 fhajny Exp $
SHA1 (LMDB-0.9.18.tar.gz) = 375e31bd0a4d8426e5fc4bfdb00d532c206d4f2b
RMD160 (LMDB-0.9.18.tar.gz) = 498e2076e9c3e1145d14d83880a54430f20875d8
SHA512 (LMDB-0.9.18.tar.gz) = 394e88d99d446eb30771d7cf7a661584683a0d6d8e976cc561b5eecbb2a5d0817bbd59994002afa4eae6c86a39f05f50ebc2eff77cd70dd8c67225df4611f5e6
Size (LMDB-0.9.18.tar.gz) = 139156 bytes
-SHA1 (patch-libraries_liblmdb_Makefile) = a21055b6ec53dae8c52a9bc325b8f84bf4282e9f
+SHA1 (patch-libraries_liblmdb_Makefile) = da5288510ae26b498e1cf8ed453bb1c74f25e54a
+SHA1 (patch-libraries_liblmdb_mdb.c) = 26d1dd1e59b30f8e814bcc3a5d2ff9fd449f83ab
diff -r a85bac76bdb3 -r d3baf4972d19 databases/lmdb/patches/patch-libraries_liblmdb_Makefile
--- a/databases/lmdb/patches/patch-libraries_liblmdb_Makefile Fri Nov 25 15:40:09 2016 +0000
+++ b/databases/lmdb/patches/patch-libraries_liblmdb_Makefile Fri Nov 25 15:50:13 2016 +0000
@@ -1,9 +1,7 @@
-$NetBSD: patch-libraries_liblmdb_Makefile,v 1.2 2016/02/16 12:16:28 mef Exp $
+$NetBSD: patch-libraries_liblmdb_Makefile,v 1.3 2016/11/25 15:50:13 fhajny Exp $
Use proper install commands.
- clean:
- rm -rf $(PROGS) *.[ao] *.[ls]o *~ testdb
--- libraries/liblmdb/Makefile.orig 2016-02-06 06:22:15.000000000 +0900
+++ libraries/liblmdb/Makefile 2016-02-16 21:08:37.000000000 +0900
@@ -48,10 +48,10 @@ install: $(ILIBS) $(IPROGS) $(IHDRS)
diff -r a85bac76bdb3 -r d3baf4972d19 databases/lmdb/patches/patch-libraries_liblmdb_mdb.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/databases/lmdb/patches/patch-libraries_liblmdb_mdb.c Fri Nov 25 15:50:13 2016 +0000
@@ -0,0 +1,36 @@
+$NetBSD: patch-libraries_liblmdb_mdb.c,v 1.1 2016/11/25 15:50:13 fhajny Exp $
+
+Backport upstream fix for SunOS.
+
+https://github.com/LMDB/lmdb/commit/c367c1f69685a4d307acb8cea6945c1d67e1cc7e.patch
+
+Check for PTHREAD_MUTEX_ROBUST_NP definition (this doesn't work
+on Linux/glibc because they used an enum). Zero out mutex before
+initing.
+
+--- libraries/liblmdb/mdb.c.orig 2016-02-05 21:22:15.000000000 +0000
++++ libraries/liblmdb/mdb.c
+@@ -257,7 +257,8 @@ typedef SSIZE_T ssize_t;
+ # else
+ # define MDB_USE_ROBUST 1
+ /* glibc < 2.12 only provided _np API */
+-# if defined(__GLIBC__) && GLIBC_VER < 0x02000c
++# if (defined(__GLIBC__) && GLIBC_VER < 0x02000c) || \
++ (defined(PTHREAD_MUTEX_ROBUST_NP) && !defined(PTHREAD_MUTEX_ROBUST))
+ # define PTHREAD_MUTEX_ROBUST PTHREAD_MUTEX_ROBUST_NP
+ # define pthread_mutexattr_setrobust(attr, flag) pthread_mutexattr_setrobust_np(attr, flag)
+ # define pthread_mutex_consistent(mutex) pthread_mutex_consistent_np(mutex)
+@@ -4619,6 +4620,13 @@ mdb_env_setup_locks(MDB_env *env, char *
+ #else /* MDB_USE_POSIX_MUTEX: */
+ pthread_mutexattr_t mattr;
+
++ /* Solaris needs this before initing a robust mutex. Otherwise
++ * it may skip the init and return EBUSY "seems someone already
++ * inited" or EINVAL "it was inited differently".
++ */
++ memset(env->me_txns->mti_rmutex, 0, sizeof(*env->me_txns->mti_rmutex));
++ memset(env->me_txns->mti_wmutex, 0, sizeof(*env->me_txns->mti_wmutex));
++
+ if ((rc = pthread_mutexattr_init(&mattr))
+ || (rc = pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED))
+ #ifdef MDB_ROBUST_SUPPORTED
Home |
Main Index |
Thread Index |
Old Index