diff options
author | Stef Walter <stefw@gnome.org> | 2013-02-20 10:08:34 +0100 |
---|---|---|
committer | Stef Walter <stefw@gnome.org> | 2013-03-03 10:06:45 +0100 |
commit | b06bee023df6f4f2b004030e86e8ee90579681f5 (patch) | |
tree | e17f54b098b9e82cca3b8ae76ce5470f18b4cccc /p11-kit | |
parent | 6521cccc021530f59f2f5e60a9cbf0c5b458360d (diff) |
Rename p11_module_xxx() compat functions to p11_dl_xxx()
For clarity. In addition, make p11_dl_close() able to be used
as a destroyer callback.
Also make p11_dl_error() return an allocated string
Diffstat (limited to 'p11-kit')
-rw-r--r-- | p11-kit/modules.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/p11-kit/modules.c b/p11-kit/modules.c index 62ecbe7..eaa1564 100644 --- a/p11-kit/modules.c +++ b/p11-kit/modules.c @@ -190,7 +190,7 @@ free_module_unlocked (void *data) assert (mod->ref_count == 0); if (mod->dl_module) - p11_module_close (mod->dl_module); + p11_dl_close (mod->dl_module); p11_mutex_uninit (&mod->initialize_mutex); p11_dict_free (mod->config); @@ -253,21 +253,26 @@ static CK_RV dlopen_and_get_function_list (Module *mod, const char *path) { CK_C_GetFunctionList gfl; + char *error; CK_RV rv; assert (mod); assert (path); - mod->dl_module = p11_module_open (path); + mod->dl_module = p11_dl_open (path); if (mod->dl_module == NULL) { - p11_message ("couldn't load module: %s: %s", path, p11_module_error ()); + error = p11_dl_error (); + p11_message ("couldn't load module: %s: %s", path, error); + free (error); return CKR_GENERAL_ERROR; } - gfl = p11_module_symbol (mod->dl_module, "C_GetFunctionList"); + gfl = p11_dl_symbol (mod->dl_module, "C_GetFunctionList"); if (!gfl) { + error = p11_dl_error (); p11_message ("couldn't find C_GetFunctionList entry point in module: %s: %s", - path, p11_module_error ()); + path, error); + free (error); return CKR_GENERAL_ERROR; } |