diff options
-rw-r--r-- | tests/mock-module-ep.c | 1 | ||||
-rw-r--r-- | tests/mock-module.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/tests/mock-module-ep.c b/tests/mock-module-ep.c index c784546..7440a74 100644 --- a/tests/mock-module-ep.c +++ b/tests/mock-module-ep.c @@ -44,6 +44,7 @@ __declspec(dllexport) CK_RV C_GetFunctionList (CK_FUNCTION_LIST_PTR_PTR list) { + mock_module_init (); if (list == NULL) return CKR_ARGUMENTS_BAD; *list = &mock_module_no_slots; diff --git a/tests/mock-module.c b/tests/mock-module.c index 36515d0..99cde50 100644 --- a/tests/mock-module.c +++ b/tests/mock-module.c @@ -890,5 +890,9 @@ CK_FUNCTION_LIST mock_module_no_slots = { void mock_module_init (void) { - _p11_mutex_init (&init_mutex); + static int initialized = 0; + if (!initialized) { + _p11_mutex_init (&init_mutex); + initialized = 1; + } } |