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.6.2~11 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f5aa4ae8283e4865ee614b8f61590dad9b24f0b5;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 b6d564659..2dd31ffd6 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -1575,6 +1575,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,