Fix: payload view: payload view always refers to parent's position
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 23 Jun 2020 04:23:01 +0000 (00:23 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 27 Jul 2020 20:31:35 +0000 (16:31 -0400)
A payload view's fd iterator must point to the root view's fd iterator
and not necessarily its parent's. This would cause the iterator
to be reset when views were nested more than two levels deep.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I37eab2ca1437b1a8446449984619106ffff90d3a

src/common/payload-view.c

index f15fa844788e21682fe87c58544485158050ef28..2daa7d3ee5e7221d86a9805a01215ab72bf83a6a 100644 (file)
@@ -30,9 +30,10 @@ struct lttng_payload_view lttng_payload_view_from_view(
 {
        return (struct lttng_payload_view) {
                .buffer = lttng_buffer_view_from_view(
-                       &view->buffer, offset, len),
+                               &view->buffer, offset, len),
                ._fds = view->_fds,
-               ._iterator.p_fds_position = &view->_iterator.fds_position,
+               ._iterator.p_fds_position = view->_iterator.p_fds_position ?:
+                               &view->_iterator.fds_position,
        };
 }
 
This page took 0.034947 seconds and 4 git commands to generate.