From e5c5dc9cae56bdea02f7661c1c8a8cacfbe99f1c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 25 Jan 2016 12:50:29 +0100 Subject: move plugin path setup logic to libtalerutil --- src/mintdb/mintdb_plugin.c | 62 ---------------------------------------------- 1 file changed, 62 deletions(-) (limited to 'src/mintdb') diff --git a/src/mintdb/mintdb_plugin.c b/src/mintdb/mintdb_plugin.c index f1b2ad044..4a0f1dc04 100644 --- a/src/mintdb/mintdb_plugin.c +++ b/src/mintdb/mintdb_plugin.c @@ -83,67 +83,5 @@ TALER_MINTDB_plugin_unload (struct TALER_MINTDB_Plugin *plugin) } -/** - * Libtool search path before we started. - */ -static char *old_dlsearchpath; - - -/** - * Setup libtool paths. - */ -void __attribute__ ((constructor)) -plugin_init () -{ - 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 = TALER_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 () -{ - lt_dlsetsearchpath (old_dlsearchpath); - if (NULL != old_dlsearchpath) - { - GNUNET_free (old_dlsearchpath); - old_dlsearchpath = NULL; - } - lt_dlexit (); -} - /* end of mintdb_plugin.c */ -- cgit v1.2.3