do not daemonize when running tests
authorChristian Grothoff <christian@grothoff.org>
Wed, 21 Jul 2010 10:11:37 +0000 (10:11 +0000)
committerChristian Grothoff <christian@grothoff.org>
Wed, 21 Jul 2010 10:11:37 +0000 (10:11 +0000)
src/arm/arm_api.c

index dbd65cae2e988655a3023ee88d4fb50ac1154e56..2d7ac931c427f6771032da4875379f00b137354d 100644 (file)
@@ -434,16 +434,38 @@ 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 (cfg,
+                                                      "TESTING",
+                                                      "WEAKRANDOM")) &&
+      (GNUNET_YES == GNUNET_CONFIGURATION_get_value_yesno (cfg,
+                                                           "TESTING",
+                                                           "WEAKRANDOM")))
+    {
+      /* 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);