-trying to fix double-start issue on sparc
authorChristian Grothoff <christian@grothoff.org>
Mon, 30 Jan 2012 13:26:11 +0000 (13:26 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 30 Jan 2012 13:26:11 +0000 (13:26 +0000)
src/arm/gnunet-service-arm.c
src/util/configuration.c

index 88fabef2fccc6782f81ded5da9ebb026c1add8fd..064cb9777c0af57edd2dddd4fd05e8dc60674236 100644 (file)
@@ -308,6 +308,7 @@ start_process (struct ServiceList *sl)
              "Starting service `%s' using binary `%s' and configuration `%s'\n",
              sl->name, sl->binary, sl->config);
 #endif
+  GNUNET_assert (NULL == sl->proc);
   if (GNUNET_YES == use_debug)
     sl->proc =
       do_start_process (lsocks, loprefix, sl->binary, "-c", sl->config, "-L",
@@ -407,7 +408,7 @@ find_service (const char *name)
   sl = running_head;
   while (sl != NULL)
     {
-      if (0 == strcmp (sl->name, name))
+      if (0 == strcasecmp (sl->name, name))
        return sl;
       sl = sl->next;
     }
@@ -1041,6 +1042,13 @@ setup_service (void *cls, const char *section)
       /* not a service section */
       return;
     }
+  sl = find_service (section);
+  if (NULL != sl)
+  {
+    /* got the same section twice!? */
+    GNUNET_break (0);
+    return;
+  }
   config = NULL;
   if ((GNUNET_OK !=
        GNUNET_CONFIGURATION_get_value_filename (cfg, section, "CONFIG",
index 50f32e2864d49d698883c9596b2e42327ccba4ad..f24b2c2c62002bb79f4d9e2a651bdb1aebf115f9 100644 (file)
@@ -407,7 +407,7 @@ GNUNET_CONFIGURATION_iterate_section_values (const struct
   struct ConfigEntry *epos;
 
   spos = cfg->sections;
-  while ((spos != NULL) && (0 != strcmp (spos->name, section)))
+  while ((spos != NULL) && (0 != strcasecmp (spos->name, section)))
     spos = spos->next;
 
   if (spos == NULL)
@@ -465,7 +465,7 @@ GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle *cfg,
   spos = cfg->sections;
   while (spos != NULL)
   {
-    if (0 == strcmp (section, spos->name))
+    if (0 == strcasecmp (section, spos->name))
     {
       if (prev == NULL)
         cfg->sections = spos->next;