From: Jérémie Galarneau Date: Tue, 30 Jul 2024 20:36:13 +0000 (+0000) Subject: sessiond: client.cpp: iterate on list using list_iteration_adapter X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=549d5750fbabe8881e2f37fecdbbf48e9bc253ea;p=lttng-tools.git sessiond: client.cpp: iterate on list using list_iteration_adapter Change-Id: Ibb45513080329e805c757cfc69a99eaa14387ac0 Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/client.cpp b/src/bin/lttng-sessiond/client.cpp index 9052546c4..db9442b8e 100644 --- a/src/bin/lttng-sessiond/client.cpp +++ b/src/bin/lttng-sessiond/client.cpp @@ -581,11 +581,12 @@ error_create: static unsigned int lttng_sessions_count(uid_t uid, gid_t gid __attribute__((unused))) { unsigned int i = 0; - struct ltt_session *raw_session_ptr; const struct ltt_session_list *session_list = session_get_list(); DBG("Counting number of available session for UID %d", uid); - cds_list_for_each_entry (raw_session_ptr, &session_list->head, list) { + for (auto *raw_session_ptr : + lttng::urcu::list_iteration_adapter( + session_list->head)) { auto session = [raw_session_ptr]() { session_get(raw_session_ptr); raw_session_ptr->lock();