From 4671352fe2a4f56c6707322dcab0015e2e8600c4 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Mon, 17 Dec 2012 17:11:50 +0100 Subject: Only initialize p11-kit libraries once * Make the gcc constructor call p11_library_init_once() --- common/library.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'common/library.c') diff --git a/common/library.c b/common/library.c index e8547b3..48fd0c9 100644 --- a/common/library.c +++ b/common/library.c @@ -159,11 +159,8 @@ _p11_library_get_thread_local (void) return local; } -#ifdef __GNUC__ -__attribute__((constructor)) -#endif void -p11_library_init (void) +p11_library_init_impl (void) { p11_debug_init (); p11_debug ("initializing library"); @@ -172,6 +169,15 @@ p11_library_init (void) } #ifdef __GNUC__ +__attribute__((constructor)) +#endif +void +p11_library_init (void) +{ + p11_library_init_once (); +} + +#ifdef __GNUC__ __attribute__((destructor)) #endif void -- cgit v1.1