diff options
Diffstat (limited to 'src/backenddb')
-rw-r--r-- | src/backenddb/Makefile.am | 1 | ||||
-rw-r--r-- | src/backenddb/merchantdb_plugin.c | 75 | ||||
-rw-r--r-- | src/backenddb/test_merchantdb.c | 3 |
3 files changed, 6 insertions, 73 deletions
diff --git a/src/backenddb/Makefile.am b/src/backenddb/Makefile.am index a55941ff..8ade2260 100644 --- a/src/backenddb/Makefile.am +++ b/src/backenddb/Makefile.am @@ -231,6 +231,7 @@ test_merchantdb_postgres_LDFLAGS = \ $(XLIB) test_merchantdb_postgres_LDADD = \ + $(top_builddir)/src/util/libtalermerchantutil.la \ $(top_builddir)/src/backenddb/libtalermerchantdb.la TESTS = \ 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 */ diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c index 8671cfc5..5958742f 100644 --- a/src/backenddb/test_merchantdb.c +++ b/src/backenddb/test_merchantdb.c @@ -24,6 +24,7 @@ #include <taler/taler_util.h> #include <taler/taler_json_lib.h> #include <taler/taler_signatures.h> +#include "taler_merchant_util.h" #include "taler_merchantdb_lib.h" @@ -7363,7 +7364,7 @@ main (int argc, "%s.conf", testname); fprintf (stdout, "Using %s\n", config_filename); - cfg = GNUNET_CONFIGURATION_create (); + cfg = GNUNET_CONFIGURATION_create (TALER_MERCHANT_project_data ()); if (GNUNET_OK != GNUNET_CONFIGURATION_parse (cfg, config_filename)) |