aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-03-21 14:04:13 +0100
committerChristian Grothoff <christian@grothoff.org>2015-03-21 14:04:13 +0100
commit067d4891411f7add6256352e661aab9fb0b58266 (patch)
tree5296c1c4d0d3b998fa7a33c8005b94d0c5c866c5 /src
parent7d9a40327587ed99fb20f4c4a5669069c7a51e48 (diff)
-fix FTBFS
Diffstat (limited to 'src')
-rw-r--r--src/mint/taler-mint-dbinit.c34
-rw-r--r--src/mint/taler-mint-httpd.c2
2 files changed, 9 insertions, 27 deletions
diff --git a/src/mint/taler-mint-dbinit.c b/src/mint/taler-mint-dbinit.c
index 060eabc7b..8056b7df0 100644
--- a/src/mint/taler-mint-dbinit.c
+++ b/src/mint/taler-mint-dbinit.c
@@ -23,7 +23,7 @@
#include <libpq-fe.h>
#include "taler_util.h"
#include "taler_mintdb_plugin.h"
-
+#include "plugin.h"
/**
* Mint directory with the keys.
@@ -35,12 +35,6 @@ static char *mint_base_dir;
*/
static struct GNUNET_CONFIGURATION_Handle *cfg;
-/**
- * Database connection handle.
- */
-static PGconn *db_conn;
-
-
/**
* The main function of the database initialization tool.
@@ -61,7 +55,6 @@ main (int argc,
&GNUNET_GETOPT_set_filename, &mint_base_dir},
GNUNET_GETOPT_OPTION_END
};
- char *db_connection_cfg_str;
if (GNUNET_GETOPT_run ("taler-mint-dbinit",
options,
@@ -78,7 +71,6 @@ main (int argc,
"Mint base directory not given.\n");
return 1;
}
-
cfg = TALER_config_load (mint_base_dir);
if (NULL == cfg)
{
@@ -87,32 +79,22 @@ main (int argc,
return 1;
}
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg,
- "mint",
- "db",
- &db_connection_cfg_str))
+ TALER_MINT_plugin_load (cfg))
{
fprintf (stderr,
- "Configuration 'mint.db' not found.\n");
+ "Failed to initialize database plugin.\n");
return 1;
}
- db_conn = PQconnectdb (db_connection_cfg_str);
- if (CONNECTION_OK != PQstatus (db_conn))
- {
- fprintf (stderr,
- "Database connection failed: %s\n",
- PQerrorMessage (db_conn));
- free (db_connection_cfg_str);
- return 1;
- }
- free (db_connection_cfg_str);
-
- if (GNUNET_OK != TALER_MINT_DB_create_tables (GNUNET_NO))
+ if (GNUNET_OK !=
+ plugin->create_tables (plugin->cls,
+ GNUNET_NO))
{
fprintf (stderr,
"Failed to initialize database.\n");
+ TALER_MINT_plugin_unload ();
return 1;
}
+ TALER_MINT_plugin_unload ();
return 0;
}
diff --git a/src/mint/taler-mint-httpd.c b/src/mint/taler-mint-httpd.c
index 9adf26dfd..70d3b64f0 100644
--- a/src/mint/taler-mint-httpd.c
+++ b/src/mint/taler-mint-httpd.c
@@ -36,6 +36,7 @@
#include "taler-mint-httpd_refresh.h"
#include "taler-mint-httpd_keystate.h"
#include "taler_mintdb_plugin.h"
+#include "plugin.h"
/**
@@ -229,7 +230,6 @@ mint_serve_process_config (const char *mint_directory)
unsigned long long port;
unsigned long long kappa;
char *master_pub_str;
- char *db_cfg;
cfg = TALER_config_load (mint_directory);
if (NULL == cfg)