From 31c02fb796462c07482101ab2845827f98df30d0 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 4 Feb 2020 15:46:41 -0500 Subject: [PATCH] Fix: event notifier: adapt read iterator state to poll expectations When completing to read a subbuffer, ensure that the state of the iterator is moved forward so the "put_subbuf" is performed before returning to the user, so poll() will not return POLLIN when there is actually no data available to read. Signed-off-by: Mathieu Desnoyers Change-Id: Ia94b5dcb0c72d8548325b1004f214044f50fd191 --- src/lttng-abi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lttng-abi.c b/src/lttng-abi.c index 09e43788..c62e295e 100644 --- a/src/lttng-abi.c +++ b/src/lttng-abi.c @@ -909,11 +909,14 @@ skip_get_next: } read_count += copy_len; } - return read_count; + goto put_record; nodata: *ppos = 0; chan->iter.len_left = 0; + +put_record: + lib_ring_buffer_put_current_record(buf); return read_count; } -- 2.34.1