-fix channel data range to make -1 legal value
[oweals/gnunet.git] / src / testbed / testbed_api_hosts.c
index 51bd632c741fa2af8d381e4b2c89e53813842cdd..ed3379d880e2bf933ec91341832307e5c247c56f 100644 (file)
@@ -331,7 +331,7 @@ GNUNET_TESTBED_host_create_with_id (uint32_t id, const char *hostname,
     LOG (GNUNET_ERROR_TYPE_WARNING, "Host with id: %u already created\n", id);
     return NULL;
   }
-  host = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Host));
+  host = GNUNET_new (struct GNUNET_TESTBED_Host);
   host->hostname = (NULL != hostname) ? GNUNET_strdup (hostname) : NULL;
   host->username = (NULL != username) ? GNUNET_strdup (username) : NULL;
   host->id = id;
@@ -565,7 +565,7 @@ GNUNET_TESTBED_hosts_load_from_loadleveler (const struct
                                             GNUNET_CONFIGURATION_Handle *cfg,
                                             struct GNUNET_TESTBED_Host ***hosts)
 {
-#if !ENABLE_LL
+#if !ENABLE_SUPERMUC
   LOG (GNUNET_ERROR_TYPE_ERROR,
        _("The function %s is only available when compiled with (--with-ll)\n"),
        __func__);
@@ -649,7 +649,7 @@ GNUNET_TESTBED_mark_host_registered_at_ (struct GNUNET_TESTBED_Host *host,
       return;
     }
   }
-  rc = GNUNET_malloc (sizeof (struct RegisteredController));
+  rc = GNUNET_new (struct RegisteredController);
   rc->controller = controller;
   GNUNET_CONTAINER_DLL_insert_tail (host->rc_head, host->rc_tail, rc);
 }
@@ -1079,7 +1079,7 @@ GNUNET_TESTBED_controller_start (const char *trusted_ip,
   host->locked = GNUNET_YES;
   API_VIOLATION (GNUNET_NO == host->controller_started,
                  "Attempting to start a controller on a host which is already started a controller");
-  cp = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_ControllerProc));
+  cp = GNUNET_new (struct GNUNET_TESTBED_ControllerProc);
   if (0 == GNUNET_TESTBED_host_get_id_ (host))
   {
     cp->helper =
@@ -1102,7 +1102,7 @@ GNUNET_TESTBED_controller_start (const char *trusted_ip,
     GNUNET_asprintf (&port, "%u", host->port);
     LOG_DEBUG ("Starting remote connection to destination %s\n", hostname);
     if (GNUNET_OK !=
-        GNUNET_CONFIGURATION_get_value_string (cfg, "testbed",
+        GNUNET_CONFIGURATION_get_value_filename (cfg, "testbed",
                                                "HELPER_BINARY_PATH",
                                                &helper_binary_path_args[0]))
       helper_binary_path_args[0] =
@@ -1324,13 +1324,13 @@ GNUNET_TESTBED_is_host_habitable (const struct GNUNET_TESTBED_Host *host,
   const char *hostname;
   char *port;
 
-  h = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_HostHabitableCheckHandle));
+  h = GNUNET_new (struct GNUNET_TESTBED_HostHabitableCheckHandle);
   h->cb = cb;
   h->cb_cls = cb_cls;
   h->host = host;
   hostname = (NULL == host->hostname) ? "127.0.0.1" : host->hostname;
   if (GNUNET_OK !=
-      GNUNET_CONFIGURATION_get_value_string (config, "testbed",
+      GNUNET_CONFIGURATION_get_value_filename (config, "testbed",
                                              "HELPER_BINARY_PATH",
                                              &stat_args[1]))
     stat_args[1] =
@@ -1349,7 +1349,7 @@ GNUNET_TESTBED_is_host_habitable (const struct GNUNET_TESTBED_Host *host,
   free_argv (rsh_args);
   h->auxp =
       GNUNET_OS_start_process_vap (GNUNET_NO, GNUNET_OS_INHERIT_STD_ERR, NULL,
-                                   NULL, h->helper_argv[0], h->helper_argv);
+                                   NULL, NULL, h->helper_argv[0], h->helper_argv);
   if (NULL == h->auxp)
   {
     GNUNET_break (0);           /* Cannot exec SSH? */
@@ -1374,7 +1374,7 @@ GNUNET_TESTBED_is_host_habitable_cancel (struct
                                          *handle)
 {
   GNUNET_SCHEDULER_cancel (handle->habitability_check_task);
-  (void) GNUNET_OS_process_kill (handle->auxp, SIGTERM);
+  (void) GNUNET_OS_process_kill (handle->auxp, GNUNET_TERM_SIG);
   (void) GNUNET_OS_process_wait (handle->auxp);
   GNUNET_OS_process_destroy (handle->auxp);
   free_argv (handle->helper_argv);
@@ -1449,7 +1449,7 @@ GNUNET_TESTBED_register_host (struct GNUNET_TESTBED_Controller *controller,
          (NULL == hostname) ? "localhost" : hostname);
     return NULL;
   }
-  rh = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_HostRegistrationHandle));
+  rh = GNUNET_new (struct GNUNET_TESTBED_HostRegistrationHandle);
   rh->host = host;
   rh->c = controller;
   GNUNET_assert (NULL != cc);