aboutsummaryrefslogtreecommitdiff
path: root/src/arm/test_arm_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-01-26 09:50:37 +0000
committerChristian Grothoff <christian@grothoff.org>2013-01-26 09:50:37 +0000
commitba007d1a80d1d376712d362881b17d64b36898d8 (patch)
tree60a19634db750591788057ae137b766aa4f034d0 /src/arm/test_arm_api.c
parentdeec9d09189a4e2a2fd52468e9905dcf1b8d023d (diff)
downloadgnunet-ba007d1a80d1d376712d362881b17d64b36898d8.tar.gz
gnunet-ba007d1a80d1d376712d362881b17d64b36898d8.zip
LRN: Here's a patch. See if it doesn't break anything for you.
Arm service is started with -c <configname> only when the process that runs arm service has "[arm]/CONFIG" defined in the configuration used to run arm service (usually - process' own configuration). Since default [arm] config has no CONFIG defined anymore (thanks to your r25908), we need to add this code to put the config file that was passed to gnunet-arm tool via -c as "[arm]/CONFIG" for arm service to receive it. Otherwise arm service is run without config and reads default config (~/.gnunet/gnunet.conf) instead, which is clearly not what we need.
Diffstat (limited to 'src/arm/test_arm_api.c')
-rw-r--r--src/arm/test_arm_api.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/arm/test_arm_api.c b/src/arm/test_arm_api.c
index e9bda410b..608c75cd3 100644
--- a/src/arm/test_arm_api.c
+++ b/src/arm/test_arm_api.c
@@ -118,7 +118,20 @@ static void
118task (void *cls, char *const *args, const char *cfgfile, 118task (void *cls, char *const *args, const char *cfgfile,
119 const struct GNUNET_CONFIGURATION_Handle *c) 119 const struct GNUNET_CONFIGURATION_Handle *c)
120{ 120{
121 char *armconfig;
121 cfg = c; 122 cfg = c;
123 if (NULL != cfgfile)
124 {
125 if (GNUNET_OK !=
126 GNUNET_CONFIGURATION_get_value_filename (cfg, "arm", "CONFIG",
127 &armconfig))
128 {
129 GNUNET_CONFIGURATION_set_value_string (cfg, "arm", "CONFIG",
130 cfgfile);
131 }
132 else
133 GNUNET_free (armconfig);
134 }
122 arm = GNUNET_ARM_connect (cfg, NULL); 135 arm = GNUNET_ARM_connect (cfg, NULL);
123#if START_ARM 136#if START_ARM
124 GNUNET_ARM_start_service (arm, "arm", GNUNET_OS_INHERIT_STD_OUT_AND_ERR, START_TIMEOUT, &arm_notify, NULL); 137 GNUNET_ARM_start_service (arm, "arm", GNUNET_OS_INHERIT_STD_OUT_AND_ERR, START_TIMEOUT, &arm_notify, NULL);