From 5b18e77e9dbb6a598812427ba07ad6df63eb7a67 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Fri, 20 Jul 2018 11:24:48 +0200 Subject: common: Use static mutex initializer when possible This eliminates the use of pthread_mutexattr_* functions, which glibc doesn't provide the stubs. --- common/compat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'common/compat.c') diff --git a/common/compat.c b/common/compat.c index 1153f95..f0e31eb 100644 --- a/common/compat.c +++ b/common/compat.c @@ -169,8 +169,9 @@ getprogname (void) #include #include +#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP void -p11_mutex_init (p11_mutex_t *mutex) +p11_recursive_mutex_init (p11_mutex_t *mutex) { pthread_mutexattr_t attr; int ret; @@ -181,6 +182,7 @@ p11_mutex_init (p11_mutex_t *mutex) assert (ret == 0); pthread_mutexattr_destroy (&attr); } +#endif char * p11_dl_error (void) -- cgit v1.1