Fix: close indexes when rotating the trace files in splice mode
[lttng-tools.git] / src / common / consumer.c
index 2eda944e114b12de570895c28fe8eb8dd69b332e..628d06c4a8eff03d69b37e29b7a4c9ef7db95737 100644 (file)
@@ -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,
@@ -2356,7 +2362,7 @@ restart:
                                consumer_del_metadata_stream(stream, metadata_ht);
                        } else {
                                ERR("Unexpected poll events %u for sock %d", revents, pollfd);
-                               rcu_read_unlock;
+                               rcu_read_unlock();
                                goto end;
                        }
                        /* Release RCU lock for the stream looked up */
This page took 0.025756 seconds and 4 git commands to generate.