Use compiler-agnostic defines to silence warning
[lttng-tools.git] / src / bin / lttng-sessiond / clear.cpp
index 03be82d65f1ae370a2fe55c69053de5038e84fd6..2e26c880ab6d4ad9290356666fe650b8eae70708 100644 (file)
@@ -26,7 +26,7 @@ struct cmd_clear_session_reply_context {
 };
 } /* namespace */
 
-static void cmd_clear_session_reply(const struct ltt_session *session, void *_reply_context)
+static void cmd_clear_session_reply(const ltt_session::locked_ref& session, void *_reply_context)
 {
        int ret;
        ssize_t comm_ret;
@@ -53,10 +53,10 @@ static void cmd_clear_session_reply(const struct ltt_session *session, void *_re
        free(_reply_context);
 }
 
-int cmd_clear_session(struct ltt_session *session, int *sock_fd)
+int cmd_clear_session(const ltt_session::locked_ref& session, int *sock_fd)
 {
        int ret = LTTNG_OK;
-       struct cmd_clear_session_reply_context *reply_context = NULL;
+       struct cmd_clear_session_reply_context *reply_context = nullptr;
        bool session_was_active = false;
        struct ltt_kernel_session *ksession;
        struct ltt_ust_session *usess;
@@ -158,11 +158,11 @@ int cmd_clear_session(struct ltt_session *session, int *sock_fd)
                         * On success, ownership of reply_context has been
                         * passed to session_add_clear_notifier().
                         */
-                       reply_context = NULL;
+                       reply_context = nullptr;
                        *sock_fd = -1;
                }
                ret = cmd_rotate_session(
-                       session, NULL, true, LTTNG_TRACE_CHUNK_COMMAND_TYPE_DELETE);
+                       session, nullptr, true, LTTNG_TRACE_CHUNK_COMMAND_TYPE_DELETE);
                if (ret != LTTNG_OK) {
                        goto end;
                }
@@ -172,7 +172,7 @@ int cmd_clear_session(struct ltt_session *session, int *sock_fd)
        }
        if (session_was_active) {
                /* Kernel tracing */
-               if (ksession != NULL) {
+               if (ksession != nullptr) {
                        DBG("Start kernel tracing session \"%s\"", session->name);
                        ret = start_kernel_session(ksession);
                        if (ret != LTTNG_OK) {
@@ -182,7 +182,7 @@ int cmd_clear_session(struct ltt_session *session, int *sock_fd)
 
                /* Flag session that trace should start automatically */
                if (usess) {
-                       int int_ret = ust_app_start_trace_all(usess);
+                       const int int_ret = ust_app_start_trace_all(usess);
 
                        if (int_ret < 0) {
                                ret = LTTNG_ERR_UST_START_FAIL;
This page took 0.026657 seconds and 4 git commands to generate.