From: Mathieu Desnoyers Date: Tue, 4 Feb 2020 20:46:41 +0000 (-0500) Subject: Fix: event notifier: adapt read iterator state to poll expectations X-Git-Tag: v2.13.0-rc1~137 X-Git-Url: http://git.lttng.org/?a=commitdiff_plain;h=31c02fb796462c07482101ab2845827f98df30d0;p=lttng-modules.git 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 --- 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; }