From: Jérémie Galarneau Date: Fri, 27 Nov 2015 20:47:01 +0000 (-0500) Subject: Fix: close indexes when rotating the trace files in mmap mode X-Git-Tag: v2.7.1~4 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=778d7cda5a7531acd7fb72352c393743d895835e;p=lttng-tools.git Fix: close indexes when rotating the trace files in mmap mode Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/consumer.c b/src/common/consumer.c index 628d06c4a..db0e96223 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -1598,6 +1598,12 @@ ssize_t lttng_consumer_on_read_subbuffer_mmap( outfd = stream->out_fd; if (stream->index_fd >= 0) { + ret = close(stream->index_fd); + if (ret < 0) { + PERROR("Closing index"); + goto end; + } + stream->index_fd = -1; ret = index_create_file(stream->chan->pathname, stream->name, stream->uid, stream->gid, stream->chan->tracefile_size,