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 <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
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,