/** * Sends termination signal to the controller's helper process * * @param cproc the handle to the controller's helper process */ void GNUNET_TESTBED_controller_kill_ (struct GNUNET_TESTBED_ControllerProc *cproc) { if (NULL != cproc->shandle) GNUNET_HELPER_send_cancel (cproc->shandle); if (NULL != cproc->helper) GNUNET_HELPER_kill (cproc->helper, GNUNET_YES); }
/** * 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; }
/** * 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)); } }