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.7.1~5 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ad77215839fa5fd769217a0a74d3134ed85158e0;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 01ecc2446..628d06c4a 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -1781,6 +1781,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,