libpkcs11: Print error messages from PKCS#11 module loading

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4672 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
martin 2010-09-02 13:38:56 +00:00
parent 9acc8c44af
commit 4697cc386b
1 changed files with 2 additions and 3 deletions

View File

@ -42,9 +42,7 @@ C_LoadModule(const char *mspec, CK_FUNCTION_LIST_PTR_PTR funcs)
mspec = PKCS11_DEFAULT_MODULE_NAME;
mod->handle = lt_dlopen(mspec);
if (mod->handle == NULL) {
#if 0
fprintf(stderr, "lt_dlopen failed: %s\n", lt_dlerror());
#endif
goto failed;
}
@ -56,7 +54,8 @@ C_LoadModule(const char *mspec, CK_FUNCTION_LIST_PTR_PTR funcs)
rv = c_get_function_list(funcs);
if (rv == CKR_OK)
return (void *) mod;
else
fprintf(stderr, "C_GetFunctionList failed %lx", rv);
failed:
C_UnloadModule((void *) mod);
return NULL;