Fix: close indexes when rotating the trace files in splice mode
[lttng-tools.git] / src / common / consumer.c
index eed346d06253a2e44ec0298ab846b3e386da839f..b6d564659c8a69cb2709e94d5026f15e7b08146c 100644 (file)
@@ -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,
@@ -2333,7 +2339,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.025681 seconds and 4 git commands to generate.