aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-08-04 21:49:21 +0200
committerFlorian Dold <florian@dold.me>2021-08-04 21:49:21 +0200
commitadf854cd4a2e337f67493bd169e403d41db69444 (patch)
tree3030f259e616a809b7f5e1886abf64da16a3e731 /src
parentb83ec3a794d9ef8fbd689fdf1955acac7af0684d (diff)
load config file from correct location
Diffstat (limited to 'src')
-rw-r--r--src/auditor/taler-auditor-exchange.c8
-rw-r--r--src/auditor/taler-auditor-httpd.c8
-rw-r--r--src/benchmark/taler-bank-benchmark.c9
-rw-r--r--src/benchmark/taler-exchange-benchmark.c9
-rw-r--r--src/exchange/taler-exchange-httpd.c9
5 files changed, 36 insertions, 7 deletions
diff --git a/src/auditor/taler-auditor-exchange.c b/src/auditor/taler-auditor-exchange.c
index b8b8428e7..b751ea9a4 100644
--- a/src/auditor/taler-auditor-exchange.c
+++ b/src/auditor/taler-auditor-exchange.c
@@ -104,7 +104,13 @@ main (int argc,
return EXIT_INVALIDARGUMENT;
}
if (NULL == cfgfile)
- cfgfile = GNUNET_strdup (GNUNET_OS_project_data_get ()->user_config_file);
+ cfgfile = GNUNET_CONFIGURATION_default_filename ();
+ if (NULL == cfgfile)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Can't find default configuration file.\n");
+ return EXIT_NOTCONFIGURED;
+ }
cfg = GNUNET_CONFIGURATION_create ();
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
diff --git a/src/auditor/taler-auditor-httpd.c b/src/auditor/taler-auditor-httpd.c
index 1824167fe..da17e7698 100644
--- a/src/auditor/taler-auditor-httpd.c
+++ b/src/auditor/taler-auditor-httpd.c
@@ -591,7 +591,13 @@ main (int argc,
(NULL == loglev) ? "INFO" : loglev,
logfile));
if (NULL == cfgfile)
- cfgfile = GNUNET_strdup (GNUNET_OS_project_data_get ()->user_config_file);
+ cfgfile = GNUNET_CONFIGURATION_default_filename ();
+ if (NULL == cfgfile)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Can't find default configuration file.\n");
+ return EXIT_NOTCONFIGURED;
+ }
cfg = GNUNET_CONFIGURATION_create ();
if (GNUNET_SYSERR ==
GNUNET_CONFIGURATION_load (cfg,
diff --git a/src/benchmark/taler-bank-benchmark.c b/src/benchmark/taler-bank-benchmark.c
index c4887ca7d..f6c079e7f 100644
--- a/src/benchmark/taler-bank-benchmark.c
+++ b/src/benchmark/taler-bank-benchmark.c
@@ -775,8 +775,13 @@ main (int argc,
return BAD_CONFIG_FILE;
}
if (NULL == cfg_filename)
- cfg_filename = GNUNET_strdup (
- GNUNET_OS_project_data_get ()->user_config_file);
+ cfg_filename = GNUNET_CONFIGURATION_default_filename ();
+ if (NULL == cfg_filename)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Can't find default configuration file.\n");
+ return EXIT_NOTCONFIGURED;
+ }
cfg = GNUNET_CONFIGURATION_create ();
if (GNUNET_OK !=
GNUNET_CONFIGURATION_load (cfg,
diff --git a/src/benchmark/taler-exchange-benchmark.c b/src/benchmark/taler-exchange-benchmark.c
index 1087c1526..25c3b0455 100644
--- a/src/benchmark/taler-exchange-benchmark.c
+++ b/src/benchmark/taler-exchange-benchmark.c
@@ -990,8 +990,13 @@ main (int argc,
return BAD_CONFIG_FILE;
}
if (NULL == cfg_filename)
- cfg_filename = GNUNET_strdup (
- GNUNET_OS_project_data_get ()->user_config_file);
+ cfg_filename = GNUNET_CONFIGURATION_default_filename ();
+ if (NULL == cfg_filename)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Can't find default configuration file.\n");
+ return EXIT_NOTCONFIGURED;
+ }
cfg = GNUNET_CONFIGURATION_create ();
if (GNUNET_OK !=
GNUNET_CONFIGURATION_load (cfg,
diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c
index 77cf2b695..e823874de 100644
--- a/src/exchange/taler-exchange-httpd.c
+++ b/src/exchange/taler-exchange-httpd.c
@@ -1688,7 +1688,14 @@ main (int argc,
GNUNET_free (loglev);
GNUNET_free (logfile);
if (NULL == cfgfile)
- cfgfile = GNUNET_strdup (GNUNET_OS_project_data_get ()->user_config_file);
+ cfgfile = GNUNET_CONFIGURATION_default_filename ();
+ if (NULL == cfgfile)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Can't find default configuration file.\n");
+ return EXIT_NOTCONFIGURED;
+ }
+
TEH_cfg = GNUNET_CONFIGURATION_create ();
if (GNUNET_SYSERR ==
GNUNET_CONFIGURATION_load (TEH_cfg,