summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-01-26 19:03:03 +0000
committerChristian Grothoff <christian@grothoff.org>2015-01-26 19:03:03 +0000
commit47be1a48f383fc4b84a1b9369a62468dabb4bfba (patch)
treeac6981a3f5ca1c4491d7f4c13165633367c8bcfc /src
parentbc09b304a1a9795520141585cceb02916733c3a1 (diff)
patches from Hellekin to fix #3577
Diffstat (limited to 'src')
-rw-r--r--src/ats/ats_api_scheduling.c2
-rw-r--r--src/util/gnunet-config.c31
2 files changed, 30 insertions, 3 deletions
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c
index 8d2cdc84e..3bd4cddc7 100644
--- a/src/ats/ats_api_scheduling.c
+++ b/src/ats/ats_api_scheduling.c
@@ -488,7 +488,7 @@ process_ats_address_suggestion_message (void *cls,
(GNUNET_HELLO_address_check_option (ar->address,
GNUNET_HELLO_ADDRESS_INFO_INBOUND)) )
{
- GNUNET_assert (0);
+ GNUNET_assert (0); // FIXME: turn back into 'break' later!
return;
}
sh->suggest_cb (sh->suggest_cb_cls,
diff --git a/src/util/gnunet-config.c b/src/util/gnunet-config.c
index 1d204dd07..f0acf11e4 100644
--- a/src/util/gnunet-config.c
+++ b/src/util/gnunet-config.c
@@ -48,6 +48,11 @@ static char *value;
static int is_filename;
/**
+ * Whether to show the sections.
+ */
+static int list_sections;
+
+/**
* Return value from 'main'.
*/
static int ret;
@@ -72,6 +77,20 @@ print_option (void *cls, const char *section,
/**
+ * Print out given section name.
+ *
+ * @param cls unused
+ * @param section a section in the configuration file
+ */
+static void
+print_section_name (void *cls,
+ const char *section)
+{
+ fprintf (stdout, "%s\n", section);
+}
+
+
+/**
* Main function that will be run by the scheduler.
*
* @param cls closure
@@ -85,9 +104,14 @@ run (void *cls, char *const *args, const char *cfgfile,
{
struct GNUNET_CONFIGURATION_Handle *out;
- if (NULL == section)
+ if (NULL == section || list_sections)
{
- fprintf (stderr, _("--section argument is required\n"));
+ if (! list_sections)
+ {
+ fprintf (stderr, _("--section argument is required\n"));
+ }
+ fprintf (stderr, _("The following sections are available:\n"));
+ GNUNET_CONFIGURATION_iterate_sections (cfg, &print_section_name, NULL);
ret = 1;
return;
}
@@ -168,6 +192,9 @@ main (int argc, char *const *argv)
{ 'V', "value", "VALUE",
gettext_noop ("value to set"),
1, &GNUNET_GETOPT_set_string, &value },
+ { 'S', "list-sections", NULL,
+ gettext_noop ("print available configuration sections"),
+ 0, &GNUNET_GETOPT_set_one, &list_sections },
GNUNET_GETOPT_OPTION_END
};
if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))