load config file from correct location

This commit is contained in:
Florian Dold 2021-08-04 21:49:21 +02:00
parent b83ec3a794
commit adf854cd4a
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
5 changed files with 36 additions and 7 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,