sessiond: consumer_socket: use lttng::utils::container_of
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 22 Jul 2024 19:14:18 +0000 (19:14 +0000)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 30 Jul 2024 01:26:51 +0000 (01:26 +0000)
caa_container_of makes use of offsetof which is conditionally
supported for non-POD types. Replace its use by
lttng::utils::container_of.

Change-Id: I49b36b3ba7be6f4cacde7f44022db459c97bf950
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/session.cpp

index f6041584114ef62c4cb0efe3bb2c19c6bda759e8..69c06288b1c607d7dbb387f46583e225e528f88b 100644 (file)
@@ -884,7 +884,6 @@ end:
 static enum lttng_error_code session_kernel_open_packets(const ltt_session::locked_ref& session)
 {
        enum lttng_error_code ret = LTTNG_OK;
-       struct consumer_socket *socket;
        struct lttng_ht_iter iter;
        struct cds_lfht_node *node;
        struct ltt_kernel_channel *chan;
@@ -893,7 +892,7 @@ static enum lttng_error_code session_kernel_open_packets(const ltt_session::lock
 
        cds_lfht_first(session->kernel_session->consumer->socks->ht, &iter.iter);
        node = cds_lfht_iter_get_node(&iter.iter);
-       socket = caa_container_of(node, typeof(*socket), node.node);
+       auto *socket = lttng_ht_node_container_of(node, &consumer_socket::node);
 
        cds_list_for_each_entry (chan, &session->kernel_session->channel_list.head, list) {
                int open_ret;
This page took 0.027288 seconds and 4 git commands to generate.