aboutsummaryrefslogtreecommitdiff
path: root/src/util/configuration_loader.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/configuration_loader.c')
-rw-r--r--src/util/configuration_loader.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/util/configuration_loader.c b/src/util/configuration_loader.c
index 37cf1a75d..2caad8c05 100644
--- a/src/util/configuration_loader.c
+++ b/src/util/configuration_loader.c
@@ -29,7 +29,7 @@
29 29
30#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 30#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
31 31
32#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename) 32
33/** 33/**
34 * Load configuration (starts with defaults, then loads 34 * Load configuration (starts with defaults, then loads
35 * system-specific configuration). 35 * system-specific configuration).
@@ -43,14 +43,21 @@ GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg,
43 const char *filename) 43 const char *filename)
44{ 44{
45 char *baseconfig; 45 char *baseconfig;
46 char *ipath;
47 46
48 ipath = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR); 47 if (NULL != (baseconfig = getenv ("GNUNET_BASE_CONFIG")))
49 if (NULL == ipath) 48 {
50 return GNUNET_SYSERR; 49 baseconfig = GNUNET_strdup (baseconfig);
51 baseconfig = NULL; 50 }
52 GNUNET_asprintf (&baseconfig, "%s%s", ipath, "config.d"); 51 else
53 GNUNET_free (ipath); 52 {
53 char *ipath;
54
55 ipath = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR);
56 if (NULL == ipath)
57 return GNUNET_SYSERR;
58 GNUNET_asprintf (&baseconfig, "%s%s", ipath, "config.d");
59 GNUNET_free (ipath);
60 }
54 61
55 if (GNUNET_SYSERR == 62 if (GNUNET_SYSERR ==
56 GNUNET_CONFIGURATION_load_from (cfg, 63 GNUNET_CONFIGURATION_load_from (cfg,