aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/include/gnunet_constants.h5
-rw-r--r--src/include/gnunet_os_lib.h5
-rw-r--r--src/util/os_installation.c2
-rw-r--r--src/util/program.c2
-rw-r--r--src/util/service.c2
5 files changed, 9 insertions, 7 deletions
diff --git a/src/include/gnunet_constants.h b/src/include/gnunet_constants.h
index 747b8afd5e..000def9029 100644
--- a/src/include/gnunet_constants.h
+++ b/src/include/gnunet_constants.h
@@ -41,11 +41,6 @@ extern "C"
#endif
/**
- * Last resort choice for configuration file name.
- */
-#define GNUNET_DEFAULT_USER_CONFIG_FILE "~/.config/gnunet.conf"
-
-/**
* Bandwidth (in/out) to assume initially (before either peer has
* communicated any particular preference). Should be rather low; set
* so that at least one maximum-size message can be send roughly once
diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h
index 5785bd67fc..d4893f906b 100644
--- a/src/include/gnunet_os_lib.h
+++ b/src/include/gnunet_os_lib.h
@@ -255,6 +255,11 @@ struct GNUNET_OS_ProjectData
*/
const char *config_file;
+ /**
+ * Configuration file name to use (if $XDG_CONFIG_HOME is not set).
+ */
+ const char *user_config_file;
+
};
diff --git a/src/util/os_installation.c b/src/util/os_installation.c
index 8606d5c588..45f5052aad 100644
--- a/src/util/os_installation.c
+++ b/src/util/os_installation.c
@@ -60,6 +60,8 @@ static const struct GNUNET_OS_ProjectData default_pd = {
.env_varname = "GNUNET_PREFIX",
.bug_email = "gnunet-developers@gnu.org",
.homepage = "http://www.gnu.org/s/gnunet/",
+ .config_file = "gnunet.conf",
+ .user_config_file = "~/.config/gnunet.conf"
};
/**
diff --git a/src/util/program.c b/src/util/program.c
index a313ce87e6..bf7885fe91 100644
--- a/src/util/program.c
+++ b/src/util/program.c
@@ -225,7 +225,7 @@ GNUNET_PROGRAM_run2 (int argc, char *const *argv, const char *binaryName,
DIR_SEPARATOR_STR,
GNUNET_OS_project_data_get ()->config_file);
else
- cfg_fn = GNUNET_strdup (GNUNET_DEFAULT_USER_CONFIG_FILE);
+ cfg_fn = GNUNET_strdup (GNUNET_OS_project_data_get ()->user_config_file);
lpfx = GNUNET_strdup (binaryName);
if (NULL != (spc = strstr (lpfx, " ")))
*spc = '\0';
diff --git a/src/util/service.c b/src/util/service.c
index c7f9650214..93a51f2202 100644
--- a/src/util/service.c
+++ b/src/util/service.c
@@ -1429,7 +1429,7 @@ GNUNET_SERVICE_run (int argc, char *const *argv,
DIR_SEPARATOR_STR,
GNUNET_OS_project_data_get ()->config_file);
else
- cfg_fn = GNUNET_strdup (GNUNET_DEFAULT_USER_CONFIG_FILE);
+ cfg_fn = GNUNET_strdup (GNUNET_OS_project_data_get ()->user_config_file);
memset (&sctx, 0, sizeof (sctx));
sctx.options = options;
sctx.ready_confirm_fd = -1;