#define _LGPL_SOURCE
#include <common/common.h>
-#include <common/index/index.h>
#include <common/compat/string.h>
#include "lttng-relayd.h"
#include "viewer-stream.h"
+#include "index-file.h"
static void viewer_stream_destroy(struct relay_viewer_stream *vstream)
{
if (stream->index_received_seqcount == 0) {
vstream->index_file = NULL;
} else {
- vstream->index_file = lttng_index_file_open(vstream->path_name,
+ vstream->index_file = relay_index_file_open(vstream->path_name,
vstream->channel_name,
stream->tracefile_count,
vstream->current_tracefile_id);
}
if (seek_t == LTTNG_VIEWER_SEEK_LAST && vstream->index_file) {
- off_t lseek_ret;
+ int ret;
- lseek_ret = lseek(vstream->index_file->fd, 0, SEEK_END);
- if (lseek_ret < 0) {
+ ret = relay_index_file_seek_end(vstream->index_file);
+ if (ret < 0) {
goto error_unlock;
}
}
vstream->stream_fd = NULL;
}
if (vstream->index_file) {
- lttng_index_file_put(vstream->index_file);
+ relay_index_file_put(vstream->index_file);
vstream->index_file = NULL;
}
if (vstream->stream) {
}
if (vstream->index_file) {
- lttng_index_file_put(vstream->index_file);
+ relay_index_file_put(vstream->index_file);
vstream->index_file = NULL;
}
if (vstream->stream_fd) {
vstream->stream_fd = NULL;
}
- vstream->index_file = lttng_index_file_open(vstream->path_name,
+ vstream->index_file = relay_index_file_open(vstream->path_name,
vstream->channel_name,
stream->tracefile_count,
vstream->current_tracefile_id);