summaryrefslogtreecommitdiff
path: root/common/compat.c
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2018-07-20 11:24:48 +0200
committerDaiki Ueno <ueno@gnu.org>2018-08-10 10:11:24 +0200
commit5b18e77e9dbb6a598812427ba07ad6df63eb7a67 (patch)
treebfa85822ce98dd65358f942464dea4d06790bdbe /common/compat.c
parent22cb49b9105657cafb98624be37f05b169f73dd6 (diff)
common: Use static mutex initializer when possible
This eliminates the use of pthread_mutexattr_* functions, which glibc doesn't provide the stubs.
Diffstat (limited to 'common/compat.c')
-rw-r--r--common/compat.c4
1 files changed, 3 insertions, 1 deletions
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 <fcntl.h>
#include <unistd.h>
+#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)