sessiond: client.cpp: iterate on list using list_iteration_adapter
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 30 Jul 2024 20:36:13 +0000 (20:36 +0000)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 31 Jul 2024 03:36:52 +0000 (23:36 -0400)
Change-Id: Ibb45513080329e805c757cfc69a99eaa14387ac0
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/client.cpp

index 9052546c4042f9b668709d406234bb9d240c6808..db9442b8e4bb1d3663acfc5a080f0e7b8abfbea8 100644 (file)
@@ -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<ltt_session, &ltt_session::list>(
+                    session_list->head)) {
                auto session = [raw_session_ptr]() {
                        session_get(raw_session_ptr);
                        raw_session_ptr->lock();
This page took 0.027355 seconds and 4 git commands to generate.