aboutsummaryrefslogtreecommitdiff
path: root/src/arm/gnunet-arm.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-02-01 15:05:45 +0000
committerChristian Grothoff <christian@grothoff.org>2013-02-01 15:05:45 +0000
commit29f0b803613506c753c91fa5716c5d74fbb43dba (patch)
tree40ee599dab53ed0b0165906678b08caec31ba883 /src/arm/gnunet-arm.c
parent5e345b2ed520f16ccd5f86b7fbd552976c229a1d (diff)
downloadgnunet-29f0b803613506c753c91fa5716c5d74fbb43dba.tar.gz
gnunet-29f0b803613506c753c91fa5716c5d74fbb43dba.zip
-fix warning about modifying const cfg
Diffstat (limited to 'src/arm/gnunet-arm.c')
-rw-r--r--src/arm/gnunet-arm.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c
index 1b17e2dfe..8a98ba06b 100644
--- a/src/arm/gnunet-arm.c
+++ b/src/arm/gnunet-arm.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 (C) 2009, 2012 Christian Grothoff (and other contributing authors) 3 (C) 2009, 2012, 2013 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -113,7 +113,7 @@ static struct GNUNET_ARM_Handle *h;
113/** 113/**
114 * Our configuration. 114 * Our configuration.
115 */ 115 */
116static const struct GNUNET_CONFIGURATION_Handle *cfg; 116static struct GNUNET_CONFIGURATION_Handle *cfg;
117 117
118/** 118/**
119 * Processing stage that we are in. Simple counter. 119 * Processing stage that we are in. Simple counter.
@@ -276,6 +276,8 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
276 h = NULL; 276 h = NULL;
277 if ((end == GNUNET_YES) && (delete == GNUNET_YES)) 277 if ((end == GNUNET_YES) && (delete == GNUNET_YES))
278 delete_files (); 278 delete_files ();
279 GNUNET_CONFIGURATION_destroy (cfg);
280 cfg = NULL;
279} 281}
280 282
281 283
@@ -292,7 +294,8 @@ run (void *cls, char *const *args, const char *cfgfile,
292 const struct GNUNET_CONFIGURATION_Handle *c) 294 const struct GNUNET_CONFIGURATION_Handle *c)
293{ 295{
294 char *armconfig; 296 char *armconfig;
295 cfg = c; 297
298 cfg = GNUNET_CONFIGURATION_dup (c);
296 config_file = cfgfile; 299 config_file = cfgfile;
297 if (GNUNET_CONFIGURATION_get_value_string 300 if (GNUNET_CONFIGURATION_get_value_string
298 (cfg, "PATHS", "SERVICEHOME", &dir) != GNUNET_OK) 301 (cfg, "PATHS", "SERVICEHOME", &dir) != GNUNET_OK)
@@ -305,7 +308,7 @@ run (void *cls, char *const *args, const char *cfgfile,
305 { 308 {
306 if (GNUNET_OK != 309 if (GNUNET_OK !=
307 GNUNET_CONFIGURATION_get_value_filename (cfg, "arm", "CONFIG", 310 GNUNET_CONFIGURATION_get_value_filename (cfg, "arm", "CONFIG",
308 &armconfig)) 311 &armconfig))
309 { 312 {
310 GNUNET_CONFIGURATION_set_value_string (cfg, "arm", "CONFIG", 313 GNUNET_CONFIGURATION_set_value_string (cfg, "arm", "CONFIG",
311 cfgfile); 314 cfgfile);
@@ -318,6 +321,8 @@ run (void *cls, char *const *args, const char *cfgfile,
318 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 321 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
319 _("Fatal error initializing ARM API.\n")); 322 _("Fatal error initializing ARM API.\n"));
320 ret = 1; 323 ret = 1;
324 GNUNET_CONFIGURATION_destroy (cfg);
325 cfg = NULL;
321 return; 326 return;
322 } 327 }
323 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, 328 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,