diff options
author | Daiki Ueno <dueno@redhat.com> | 2018-07-20 13:11:36 +0200 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2018-08-10 10:11:24 +0200 |
commit | f04c2a84ad2a017a778fa2f23719318acb9ca89f (patch) | |
tree | 3fe93175e0966d29d3bf015c9bb9dd7498e65870 /common/library.c | |
parent | 5b18e77e9dbb6a598812427ba07ad6df63eb7a67 (diff) |
common, p11-kit, trust: Use pthread_once only when necessary
If the ELF constructor is usable, we don't really need the once-init
function because it is guaranteed that the code runs only once in the
constructor.
Diffstat (limited to 'common/library.c')
-rw-r--r-- | common/library.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/common/library.c b/common/library.c index 465b35d..cde8384 100644 --- a/common/library.c +++ b/common/library.c @@ -71,8 +71,10 @@ p11_mutex_t p11_virtual_mutex; #endif #ifdef OS_UNIX +#ifndef __GNUC__ pthread_once_t p11_library_once = PTHREAD_ONCE_INIT; #endif +#endif unsigned int p11_forkid = 1; @@ -146,7 +148,7 @@ p11_library_init_impl (void) void p11_library_init (void) { - p11_library_init_once (); + p11_library_init_impl (); } void |