/** * Cleans-up the controller's helper process handle * * @param cproc the handle to the controller's helper process */ void GNUNET_TESTBED_controller_destroy_ (struct GNUNET_TESTBED_ControllerProc *cproc) { if (NULL != cproc->helper) { GNUNET_break (GNUNET_OK == GNUNET_HELPER_wait (cproc->helper)); GNUNET_HELPER_destroy (cproc->helper); } if (NULL != cproc->helper_argv) free_argv (cproc->helper_argv); cproc->host->controller_started = GNUNET_NO; cproc->host->locked = GNUNET_NO; GNUNET_free_non_null (cproc->msg); GNUNET_free (cproc); }
/** * Stop the helper process, we're closing down or had an error. * * @param h handle to the helper process * @param soft_kill if #GNUNET_YES, signals termination by closing the helper's * stdin; #GNUNET_NO to signal termination by sending SIGTERM to helper */ static void stop_helper (struct GNUNET_HELPER_Handle *h, int soft_kill) { if (NULL != h->restart_task) { GNUNET_SCHEDULER_cancel (h->restart_task); h->restart_task = NULL; } else { GNUNET_break (GNUNET_OK == GNUNET_HELPER_kill (h, soft_kill)); GNUNET_break (GNUNET_OK == GNUNET_HELPER_wait (h)); } }