* Only return non-zero on a fatal error that should shut down the action
* executor.
*/
-typedef int (*action_executor_handler)(struct action_executor *executor,
- const struct action_work_item *,
- struct action_work_subitem *item);
+using action_executor_handler = int (*)(struct action_executor *,
+ const struct action_work_item *,
+ struct action_work_subitem *);
static int action_executor_notify_handler(struct action_executor *executor,
const struct action_work_item *,
work_item->client_list,
work_item->trigger,
work_item->evaluation,
- work_item->object_creds.is_set ? &(work_item->object_creds.value) : NULL,
+ work_item->object_creds.is_set ? &(work_item->object_creds.value) : nullptr,
client_handle_transmission_status,
executor);
}
}
cmd_ret = (lttng_error_code) cmd_rotate_session(
- session, NULL, false, LTTNG_TRACE_CHUNK_COMMAND_TYPE_MOVE_TO_COMPLETED);
+ session, nullptr, false, LTTNG_TRACE_CHUNK_COMMAND_TYPE_MOVE_TO_COMPLETED);
switch (cmd_ret) {
case LTTNG_OK:
DBG("Successfully started rotation of session `%s` on behalf of trigger `%s`",
/* Execute item only if a trigger is registered. */
lttng_trigger_lock(work_item->trigger);
if (!lttng_trigger_is_registered(work_item->trigger)) {
- const char *trigger_name = NULL;
+ const char *trigger_name = nullptr;
uid_t trigger_owner_uid;
enum lttng_trigger_status trigger_status;
rcu_unregister_thread();
health_unregister(the_health_sessiond);
- return NULL;
+ return nullptr;
}
static bool shutdown_action_executor_thread(void *_data)
}
CDS_INIT_LIST_HEAD(&executor->work.list);
- pthread_cond_init(&executor->work.cond, NULL);
- pthread_mutex_init(&executor->work.lock, NULL);
+ pthread_cond_init(&executor->work.cond, nullptr);
+ pthread_mutex_init(&executor->work.lock, nullptr);
executor->notification_thread_handle = handle;
executor->thread = lttng_thread_create(THREAD_NAME,
/* Ownership transferred to the work item. */
work_item->evaluation = evaluation;
- evaluation = NULL;
+ evaluation = nullptr;
work_item->client_list = client_list;
work_item->object_creds.is_set = !!object_creds;
{
int ret = 0;
enum lttng_action_type type = lttng_action_get_type(action);
- const char *session_name = NULL;
+ const char *session_name = nullptr;
enum lttng_action_status status;
struct action_work_subitem subitem = {
- .action = NULL,
+ .action = nullptr,
.context = {
.session_id = LTTNG_OPTIONAL_INIT_UNSET,
},
LTTNG_ASSERT(status == LTTNG_ACTION_STATUS_OK);
for (i = 0; i < count; i++) {
- struct lttng_action *inner_action = NULL;
+ struct lttng_action *inner_action = nullptr;
inner_action = lttng_action_list_borrow_mutable_at_index(action, i);
LTTNG_ASSERT(inner_action);
* now we leave the decision to skip to the action executor for sake of
* simplicity and consistency.
*/
- if (session_name != NULL) {
+ if (session_name != nullptr) {
uint64_t session_id;
/*