Smallers steps to keep plugin running
[oweals/gnunet.git] / src / arm / arm_api.c
index 0726f7e661d104fd0d3daa7394556aaad3420a5a..66747a624acde3d7190926e1044ad00df255301d 100644 (file)
@@ -4,7 +4,7 @@
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 2, or (at your
+     by the Free Software Foundation; either version 3, or (at your
      option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
@@ -434,16 +434,42 @@ arm_service_report (void *cls,
       GNUNET_free (lopostfix);
       return;
     }
-  pid = do_start_process (NULL,
-                         loprefix,
-                         binary,
-                         "-c", config,
+  if ((GNUNET_YES == GNUNET_CONFIGURATION_have_value (pos->h->cfg,
+                                                      "TESTING",
+                                                      "WEAKRANDOM")) &&
+      (GNUNET_YES == GNUNET_CONFIGURATION_get_value_yesno (pos->h->cfg,
+                                                           "TESTING",
+                                                           "WEAKRANDOM")) &&
+      (GNUNET_NO == GNUNET_CONFIGURATION_have_value (pos->h->cfg,
+                                                     "TESTING",
+                                                     "HOSTFILE")) /* Means we are ONLY running locally */
+                                                           )
+    {
+      /* we're clearly running a test, don't daemonize */
+      pid = do_start_process (NULL,
+                             loprefix,
+                             binary,
+                             "-c", config,
 #if DEBUG_ARM
-                         "-L", "DEBUG",
+                             "-L", "DEBUG",
 #endif
-                         "-d",
-                         lopostfix,
-                         NULL);
+                             /* no daemonization! */
+                             lopostfix,
+                             NULL);
+    }
+  else
+    {
+      pid = do_start_process (NULL,
+                             loprefix,
+                             binary,
+                             "-c", config,
+#if DEBUG_ARM
+                             "-L", "DEBUG",
+#endif
+                             "-d",
+                             lopostfix,
+                             NULL);
+    }
   GNUNET_free (binary);
   GNUNET_free (config);
   GNUNET_free (loprefix);