diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-02-01 15:05:45 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-02-01 15:05:45 +0000 |
commit | 29f0b803613506c753c91fa5716c5d74fbb43dba (patch) | |
tree | 40ee599dab53ed0b0165906678b08caec31ba883 /src/arm/gnunet-arm.c | |
parent | 5e345b2ed520f16ccd5f86b7fbd552976c229a1d (diff) |
-fix warning about modifying const cfg
Diffstat (limited to 'src/arm/gnunet-arm.c')
-rw-r--r-- | src/arm/gnunet-arm.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c index 1b17e2dfea..8a98ba06b3 100644 --- a/src/arm/gnunet-arm.c +++ b/src/arm/gnunet-arm.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - (C) 2009, 2012 Christian Grothoff (and other contributing authors) + (C) 2009, 2012, 2013 Christian Grothoff (and other contributing authors) GNUnet is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -113,7 +113,7 @@ static struct GNUNET_ARM_Handle *h; /** * Our configuration. */ -static const struct GNUNET_CONFIGURATION_Handle *cfg; +static struct GNUNET_CONFIGURATION_Handle *cfg; /** * Processing stage that we are in. Simple counter. @@ -276,6 +276,8 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) h = NULL; if ((end == GNUNET_YES) && (delete == GNUNET_YES)) delete_files (); + GNUNET_CONFIGURATION_destroy (cfg); + cfg = NULL; } @@ -292,7 +294,8 @@ run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) { char *armconfig; - cfg = c; + + cfg = GNUNET_CONFIGURATION_dup (c); config_file = cfgfile; if (GNUNET_CONFIGURATION_get_value_string (cfg, "PATHS", "SERVICEHOME", &dir) != GNUNET_OK) @@ -305,7 +308,7 @@ run (void *cls, char *const *args, const char *cfgfile, { if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "arm", "CONFIG", - &armconfig)) + &armconfig)) { GNUNET_CONFIGURATION_set_value_string (cfg, "arm", "CONFIG", cfgfile); @@ -318,6 +321,8 @@ run (void *cls, char *const *args, const char *cfgfile, GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Fatal error initializing ARM API.\n")); ret = 1; + GNUNET_CONFIGURATION_destroy (cfg); + cfg = NULL; return; } GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, |