diff options
Diffstat (limited to 'src/backenddb/merchantdb_plugin.c')
-rw-r--r-- | src/backenddb/merchantdb_plugin.c | 75 |
1 files changed, 3 insertions, 72 deletions
diff --git a/src/backenddb/merchantdb_plugin.c b/src/backenddb/merchantdb_plugin.c index 1207d499..99c2717e 100644 --- a/src/backenddb/merchantdb_plugin.c +++ b/src/backenddb/merchantdb_plugin.c @@ -21,6 +21,7 @@ */ #include "platform.h" #include <taler/taler_util.h> +#include "taler_merchant_util.h" #include "taler_merchantdb_plugin.h" #include "taler_merchantdb_lib.h" #include <ltdl.h> @@ -48,7 +49,8 @@ TALER_MERCHANTDB_plugin_load (const struct GNUNET_CONFIGURATION_Handle *cfg) "libtaler_plugin_merchantdb_%s", plugin_name); GNUNET_free (plugin_name); - plugin = GNUNET_PLUGIN_load (lib_name, + plugin = GNUNET_PLUGIN_load (TALER_MERCHANT_project_data (), + lib_name, (void *) cfg); if (NULL == plugin) { @@ -74,75 +76,4 @@ TALER_MERCHANTDB_plugin_unload (struct TALER_MERCHANTDB_Plugin *plugin) } -/** - * Libtool search path before we started. - */ -static char *old_dlsearchpath; - - -/** - * Setup libtool paths. - */ -void __attribute__ ((constructor)) -plugin_init (void); - -/* Declaration to avoid compiler warning */ -void __attribute__ ((constructor)) -plugin_init (void) -{ - int err; - const char *opath; - char *path; - char *cpath; - - err = lt_dlinit (); - if (err > 0) - { - fprintf (stderr, - _ ("Initialization of plugin mechanism failed: %s!\n"), - lt_dlerror ()); - return; - } - opath = lt_dlgetsearchpath (); - if (NULL != opath) - old_dlsearchpath = GNUNET_strdup (opath); - path = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_LIBDIR); - if (NULL != path) - { - if (NULL != opath) - { - GNUNET_asprintf (&cpath, "%s:%s", opath, path); - lt_dlsetsearchpath (cpath); - GNUNET_free (path); - GNUNET_free (cpath); - } - else - { - lt_dlsetsearchpath (path); - GNUNET_free (path); - } - } -} - - -/** - * Shutdown libtool. - */ -void __attribute__ ((destructor)) -plugin_fini (void); - -/* Declaration to avoid compiler warning */ -void __attribute__ ((destructor)) -plugin_fini (void) -{ - lt_dlsetsearchpath (old_dlsearchpath); - if (NULL != old_dlsearchpath) - { - GNUNET_free (old_dlsearchpath); - old_dlsearchpath = NULL; - } - lt_dlexit (); -} - - /* end of merchantdb_plugin.c */ |