-indentation
[oweals/gnunet.git] / src / testbed / test_testbed_api_testbed_run.c
index 5c69732a32798faf56bfb182ca5991bb7d9a955d..dd8a249e90588059503b6e0abf8340d4d25edf55 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 #include "platform.h"
-#include "gnunet_common.h"
+#include "gnunet_util_lib.h"
 #include "gnunet_testbed_service.h"
 
 /**
@@ -98,6 +98,7 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
  * Signature of a main function for a testcase.
  *
  * @param cls closure
+ * @param h the run handle
  * @param num_peers number of peers in 'peers'
  * @param peers_ handle to peers run in the testbed
  * @param links_succeeded the number of overlay link connection attempts that
@@ -106,7 +107,9 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
  *          failed
  */
 static void
-test_master (void *cls, unsigned int num_peers,
+test_master (void *cls,
+             struct GNUNET_TESTBED_RunHandle *h,
+             unsigned int num_peers,
              struct GNUNET_TESTBED_Peer **peers_,
              unsigned int links_succeeded,
              unsigned int links_failed)
@@ -114,6 +117,8 @@ test_master (void *cls, unsigned int num_peers,
   result = GNUNET_OK;
   if (GNUNET_YES == wait_forever)
   {
+    if (GNUNET_SCHEDULER_NO_TASK == abort_task)
+      return;                   /* abort already scheduled */
     GNUNET_SCHEDULER_cancel (abort_task);
     abort_task = GNUNET_SCHEDULER_NO_TASK;
     (void) GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,