struct lttng_trigger *trigger, const struct lttng_credentials *cmd_creds)
{
enum lttng_error_code ret_code;
- struct lttng_condition *condition = lttng_trigger_get_condition(trigger);
+ const struct lttng_condition *condition =
+ lttng_trigger_get_const_condition(trigger);
const char *trigger_name;
uid_t trigger_owner;
enum lttng_trigger_status trigger_status;
goto end_unlock_session_list;
}
- agent_add(agt, trigger_agents_ht_by_domain);
+ agent_add(agt, the_trigger_agents_ht_by_domain);
}
ret_code = trigger_agent_enable(trigger, agt);
switch (trigger_domain) {
case LTTNG_DOMAIN_KERNEL:
ret_code = kernel_unregister_event_notifier(trigger);
+ if (ret_code != LTTNG_OK) {
+ goto end_unlock_session_list;
+ }
+
break;
case LTTNG_DOMAIN_UST:
ust_app_global_update_all_event_notifier_rules();
struct agent *agt = agent_find_by_event_notifier_domain(
trigger_domain);
- if (!agt) {
- agt = agent_create(trigger_domain);
- if (!agt) {
- ret_code = LTTNG_ERR_NOMEM;
- goto end_unlock_session_list;
- }
-
- agent_add(agt, trigger_agents_ht_by_domain);
- }
-
+ /*
+ * This trigger was never registered in the first place. Calling
+ * this function under those circumstances is an internal error.
+ */
+ assert(agt);
ret_code = trigger_agent_disable(trigger, agt);
if (ret_code != LTTNG_OK) {
goto end_unlock_session_list;
chunk_being_archived = NULL;
if (!quiet_rotation) {
ret = notification_thread_command_session_rotation_ongoing(
- notification_thread_handle,
- session->name, session->uid, session->gid,
+ the_notification_thread_handle, session->name,
+ session->uid, session->gid,
ongoing_rotation_chunk_id);
if (ret != LTTNG_OK) {
ERR("Failed to notify notification thread that a session rotation is ongoing for session %s",