{
bool is_notify = false;
const struct lttng_action *action = lttng_trigger_get_const_action(trigger);
- const struct lttng_action *inner_action;
enum lttng_action_type action_type;
LTTNG_ASSERT(action);
goto end;
}
- for_each_action_const (inner_action, action) {
+ for (auto inner_action : lttng::ctl::const_action_list_view(action)) {
if (lttng_action_get_type(inner_action) == LTTNG_ACTION_TYPE_NOTIFY) {
is_notify = true;
goto end;
if (ret) {
goto error_unlock;
}
+
end:
if (cmd->is_async) {
- free(cmd);
+ delete cmd;
cmd = nullptr;
} else {
- lttng_waiter_wake_up(&cmd->reply_waiter);
+ cmd->command_completed_waker->wake();
}
+
return ret;
+
error_unlock:
/* Wake-up and return a fatal error to the calling thread. */
- lttng_waiter_wake_up(&cmd->reply_waiter);
cmd->reply_code = LTTNG_ERR_FATAL;
+
error:
- /* Indicate a fatal error to the caller. */
- return -1;
+ ret = -1;
+ goto end;
}
static int socket_set_non_blocking(int socket)