-fixing #2434, plus some code cleanup
[oweals/gnunet.git] / src / core / test_core_api_start_only.c
index 75ba73ce357a7e8a42ca2a3a9b17add88d6b3bcc..308814b2191d83ec1be20b89c88fcfa650c1200b 100644 (file)
@@ -31,9 +31,9 @@
 #include "gnunet_program_lib.h"
 #include "gnunet_scheduler_lib.h"
 
-#define VERBOSE GNUNET_EXTRA_LOGGING
+#define VERBOSE GNUNET_NO
 
-#define TIMEOUT 3
+#define TIMEOUT 5
 
 #define START_ARM GNUNET_YES
 
@@ -129,7 +129,7 @@ init_notify (void *cls, struct GNUNET_CORE_Handle *server,
   {
     /* connect p2 */
     p2.ch =
-        GNUNET_CORE_connect (p2.cfg, 1, &p2, &init_notify, &connect_notify,
+        GNUNET_CORE_connect (p2.cfg, &p2, &init_notify, &connect_notify,
                              &disconnect_notify, &inbound_notify, GNUNET_YES,
                              &outbound_notify, GNUNET_YES, handlers);
   }
@@ -148,7 +148,7 @@ setup_peer (struct PeerContext *p, const char *cfgname)
   p->cfg = GNUNET_CONFIGURATION_create ();
 #if START_ARM
   p->arm_proc =
-      GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm",
+    GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-arm",
                                "gnunet-service-arm",
 #if VERBOSE
                                "-L", "DEBUG",
@@ -191,7 +191,7 @@ run (void *cls, char *const *args, const char *cfgfile,
                                     (GNUNET_TIME_UNIT_MINUTES, TIMEOUT),
                                     &timeout_task, NULL);
   p1.ch =
-      GNUNET_CORE_connect (p1.cfg, 1, &p1, &init_notify, &connect_notify,
+      GNUNET_CORE_connect (p1.cfg, &p1, &init_notify, &connect_notify,
                            &disconnect_notify, &inbound_notify, GNUNET_YES,
                            &outbound_notify, GNUNET_YES, handlers);
 }
@@ -208,7 +208,7 @@ stop_arm (struct PeerContext *p)
     GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ARM process %u stopped\n",
               GNUNET_OS_process_get_pid (p->arm_proc));
-  GNUNET_OS_process_close (p->arm_proc);
+  GNUNET_OS_process_destroy (p->arm_proc);
   p->arm_proc = NULL;
 #endif
   GNUNET_CONFIGURATION_destroy (p->cfg);