/** * Kills the helper, closes the pipe and frees the handle * * @param h handle to helper to stop * @param soft_kill if #GNUNET_YES, signals termination by closing the helper's * stdin; #GNUNET_NO to signal termination by sending SIGTERM to helper */ void GNUNET_HELPER_stop (struct GNUNET_HELPER_Handle *h, int soft_kill) { h->exp_cb = NULL; stop_helper (h, soft_kill); GNUNET_HELPER_destroy (h); }
/** * Function that disables a speaker. * * @param cls closure with the `struct Speaker` */ static void disable (void *cls) { struct Speaker *spe = cls; if (NULL == spe->playback_helper) { GNUNET_break (0); return; } GNUNET_break (GNUNET_OK == GNUNET_HELPER_kill (spe->playback_helper, GNUNET_NO)); GNUNET_HELPER_destroy (spe->playback_helper); spe->playback_helper = NULL; }
/** * Function that disables a microphone. * * @param cls clsoure */ static void disable (void *cls) { struct Microphone *mic = cls; if (NULL == mic->record_helper) { GNUNET_break (0); return; } GNUNET_break (GNUNET_OK == GNUNET_HELPER_kill (mic->record_helper, GNUNET_NO)); GNUNET_HELPER_destroy (mic->record_helper); mic->record_helper = NULL; }
/** * 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); }