From: Olivier Dion Date: Tue, 28 Feb 2023 22:02:38 +0000 (-0500) Subject: Fix: mi: Pass const session to mi_lttng_session X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7a96a40be44ee53ee525b80d0eaf4233a07a56a5;p=lttng-tools.git Fix: mi: Pass const session to mi_lttng_session There's no reason for session to be not constant. Change-Id: I55d63e142853f78ba643600b5c1869866ee1bb5e Signed-off-by: Olivier Dion Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/mi-lttng.cpp b/src/common/mi-lttng.cpp index 6d4f16bc6..d7833fcd5 100644 --- a/src/common/mi-lttng.cpp +++ b/src/common/mi-lttng.cpp @@ -930,7 +930,7 @@ int mi_lttng_sessions_open(struct mi_writer *writer) return mi_lttng_writer_open_element(writer, config_element_sessions); } -int mi_lttng_session(struct mi_writer *writer, struct lttng_session *session, int is_open) +int mi_lttng_session(struct mi_writer *writer, const struct lttng_session *session, int is_open) { int ret; diff --git a/src/common/mi-lttng.hpp b/src/common/mi-lttng.hpp index d6d9db944..10a3e13f5 100644 --- a/src/common/mi-lttng.hpp +++ b/src/common/mi-lttng.hpp @@ -548,7 +548,7 @@ int mi_lttng_sessions_open(struct mi_writer *writer); * Returns zero if the element's value could be written. * Negative values indicate an error. */ -int mi_lttng_session(struct mi_writer *writer, struct lttng_session *session, int is_open); +int mi_lttng_session(struct mi_writer *writer, const struct lttng_session *session, int is_open); /* * Machine interface: open a domains element.