From: Julien Desfossez Date: Fri, 27 Nov 2015 17:12:44 +0000 (-0500) Subject: Fix: close indexes when rotating the trace files in splice mode X-Git-Tag: v2.6.2~12 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=79ead7f07252097de61d6d8274d4a64232583560;p=lttng-tools.git Fix: close indexes when rotating the trace files in splice mode The consumer needs to close the old index file when doing a file rotation before opening a new one. The relay does not have this problem (handled with refcounts). Signed-off-by: Julien Desfossez Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/consumer.c b/src/common/consumer.c index b593a2ae4..b6d564659 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -1758,6 +1758,12 @@ ssize_t lttng_consumer_on_read_subbuffer_splice( 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,