Fix: close indexes when rotating the trace files in mmap mode
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 27 Nov 2015 20:47:01 +0000 (15:47 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 27 Nov 2015 20:48:56 +0000 (15:48 -0500)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/consumer.c

index 628d06c4a8eff03d69b37e29b7a4c9ef7db95737..db0e96223217d64a198af4c7ef0d21b75fa0d736 100644 (file)
@@ -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,
This page took 0.027292 seconds and 4 git commands to generate.