From: Christian Grothoff Date: Fri, 15 Apr 2016 17:42:28 +0000 (+0000) Subject: add option to set configuration file to be used by default by libgnunetutil routines X-Git-Tag: initial-import-from-subversion-38251~958 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1d3dc794d9a5e82375995af14e91668430a31293;p=oweals%2Fgnunet.git add option to set configuration file to be used by default by libgnunetutil routines --- diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h index 1cb01d038..5785bd67f 100644 --- a/src/include/gnunet_os_lib.h +++ b/src/include/gnunet_os_lib.h @@ -250,6 +250,11 @@ struct GNUNET_OS_ProjectData */ const char *homepage; + /** + * Configuration file name (in $XDG_CONFIG_HOME) to use. + */ + const char *config_file; + }; diff --git a/src/util/program.c b/src/util/program.c index 69dd455cd..a313ce87e 100644 --- a/src/util/program.c +++ b/src/util/program.c @@ -223,7 +223,7 @@ GNUNET_PROGRAM_run2 (int argc, char *const *argv, const char *binaryName, "%s%s%s", xdg, DIR_SEPARATOR_STR, - "gnunet.conf"); + GNUNET_OS_project_data_get ()->config_file); else cfg_fn = GNUNET_strdup (GNUNET_DEFAULT_USER_CONFIG_FILE); lpfx = GNUNET_strdup (binaryName); diff --git a/src/util/service.c b/src/util/service.c index 76e540302..c7f965021 100644 --- a/src/util/service.c +++ b/src/util/service.c @@ -1427,7 +1427,7 @@ GNUNET_SERVICE_run (int argc, char *const *argv, "%s%s%s", xdg, DIR_SEPARATOR_STR, - "gnunet.conf"); + GNUNET_OS_project_data_get ()->config_file); else cfg_fn = GNUNET_strdup (GNUNET_DEFAULT_USER_CONFIG_FILE); memset (&sctx, 0, sizeof (sctx));