get filename instead of get_string, nicify some strings

This commit is contained in:
Christian Grothoff 2018-04-02 17:10:05 +02:00
parent 8ebb4cda07
commit e098dbf4dc
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
5 changed files with 29 additions and 32 deletions

View File

@ -72,23 +72,23 @@ auditor_sign_run (void *cls,
if (GNUNET_OK != GNUNET_CONFIGURATION_load if (GNUNET_OK != GNUNET_CONFIGURATION_load
(cfg, ass->config_filename)) (cfg, ass->config_filename))
{ {
GNUNET_break (0); GNUNET_break (0);
TALER_TESTING_interpreter_fail (is); TALER_TESTING_interpreter_fail (is);
return; return;
} }
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cfg, GNUNET_CONFIGURATION_get_value_filename (cfg,
"paths", "paths",
"TALER_TEST_HOME", "TALER_TEST_HOME",
&test_home_dir)) &test_home_dir))
{ {
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
"paths", "paths",
"TALER_TEST_HOME"); "TALER_TEST_HOME");
GNUNET_CONFIGURATION_destroy (cfg); GNUNET_CONFIGURATION_destroy (cfg);
GNUNET_break (0); GNUNET_break (0);
TALER_TESTING_interpreter_fail (is); TALER_TESTING_interpreter_fail (is);
return; return;
} }
@ -108,8 +108,8 @@ auditor_sign_run (void *cls,
"MASTER_PUBLIC_KEY"); "MASTER_PUBLIC_KEY");
GNUNET_CONFIGURATION_destroy (cfg); GNUNET_CONFIGURATION_destroy (cfg);
GNUNET_break (0); GNUNET_break (0);
TALER_TESTING_interpreter_fail (is); TALER_TESTING_interpreter_fail (is);
return; return;
} }

View File

@ -231,18 +231,16 @@ fakebank_transfer_run (void *cls,
} }
GNUNET_asprintf (&section, GNUNET_asprintf (&section,
"merchant-instance-%s", "instance-%s",
fts->instance); fts->instance);
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string GNUNET_CONFIGURATION_get_value_filename (cfg,
(cfg, section,
section, "TIP_RESERVE_PRIV_FILENAME",
"TIP_RESERVE_PRIV_FILENAME", &keys))
&keys))
{ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Configuration fails to specify reserve" "Configuration fails to specify reserve private key filename in section %s\n",
" private key filename in section %s\n",
section); section);
GNUNET_free (section); GNUNET_free (section);
TALER_TESTING_interpreter_fail (is); TALER_TESTING_interpreter_fail (is);

View File

@ -127,10 +127,10 @@ TALER_TESTING_prepare_exchange (const char *config_filename,
} }
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cfg, GNUNET_CONFIGURATION_get_value_filename (cfg,
"paths", "paths",
"TALER_TEST_HOME", "TALER_TEST_HOME",
&test_home_dir)) &test_home_dir))
{ {
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
"paths", "paths",

View File

@ -472,13 +472,12 @@ parse_port_config (const char *section,
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cfg, GNUNET_CONFIGURATION_get_value_string (cfg,
section, section,
"unixpath_mode", "UNIXPATH_MODE",
&modestring)) &modestring))
{ {
GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
section, section,
"unixpath_mode", "UNIXPATH_MODE");
"unixpath_mode required");
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
errno = 0; errno = 0;
@ -487,8 +486,8 @@ parse_port_config (const char *section,
{ {
GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
section, section,
"unixpath_mode", "UNIXPATH_MODE",
"unixpath_mode required"); "must be octal number");
GNUNET_free (modestring); GNUNET_free (modestring);
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
@ -526,7 +525,7 @@ exchange_serve_process_config ()
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cfg, GNUNET_CONFIGURATION_get_value_string (cfg,
"taler", "taler",
"currency", "CURRENCY",
&TEH_exchange_currency_string)) &TEH_exchange_currency_string))
{ {
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
@ -545,7 +544,7 @@ exchange_serve_process_config ()
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cfg, GNUNET_CONFIGURATION_get_value_string (cfg,
"exchange", "exchange",
"master_public_key", "MASTER_PUBLIC_KEY",
&TEH_master_public_key_str)) &TEH_master_public_key_str))
{ {
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,

View File

@ -265,12 +265,12 @@ exchange_serve_process_config ()
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cfg, GNUNET_CONFIGURATION_get_value_string (cfg,
"taler", "taler",
"currency", "CURRENCY",
&exchange_currency_string)) &exchange_currency_string))
{ {
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
"taler", "taler",
"currency"); "CURRENCY");
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
if (strlen (exchange_currency_string) >= TALER_CURRENCY_LEN) if (strlen (exchange_currency_string) >= TALER_CURRENCY_LEN)