X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Fviewer-stream.c;h=2a580ca53f207840358970c0084c9894b7500cb9;hb=f465e9787f5b70d4a8f3761c60b8d6e4161e9628;hp=8b0d6ab846d225bc9db649f14e07ac7f409a5d90;hpb=df6a42ab1fc6edd419525646134989e519b717ce;p=lttng-tools.git diff --git a/src/bin/lttng-relayd/viewer-stream.c b/src/bin/lttng-relayd/viewer-stream.c index 8b0d6ab84..2a580ca53 100644 --- a/src/bin/lttng-relayd/viewer-stream.c +++ b/src/bin/lttng-relayd/viewer-stream.c @@ -19,11 +19,11 @@ #define _LGPL_SOURCE #include -#include #include #include "lttng-relayd.h" #include "viewer-stream.h" +#include "index-file.h" static void viewer_stream_destroy(struct relay_viewer_stream *vstream) { @@ -118,7 +118,7 @@ struct relay_viewer_stream *viewer_stream_create(struct relay_stream *stream, 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); @@ -128,10 +128,10 @@ struct relay_viewer_stream *viewer_stream_create(struct relay_stream *stream, } 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; } } @@ -184,7 +184,7 @@ static void viewer_stream_release(struct urcu_ref *ref) 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) { @@ -297,7 +297,7 @@ int viewer_stream_rotate(struct relay_viewer_stream *vstream) } 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) { @@ -305,7 +305,7 @@ int viewer_stream_rotate(struct relay_viewer_stream *vstream) 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);