vstream->path_name = lttng_strndup(stream->path_name, LTTNG_VIEWER_PATH_MAX);
if (vstream->path_name == NULL) {
PERROR("relay viewer path_name alloc");
vstream->path_name = lttng_strndup(stream->path_name, LTTNG_VIEWER_PATH_MAX);
if (vstream->path_name == NULL) {
PERROR("relay viewer path_name alloc");
if (stream->is_metadata && stream->trace->viewer_metadata_stream) {
ERR("Cannot attach viewer metadata stream to trace (busy).");
if (stream->is_metadata && stream->trace->viewer_metadata_stream) {
ERR("Cannot attach viewer metadata stream to trace (busy).");
const uint32_t connection_major = stream->trace->session->major;
const uint32_t connection_minor = stream->trace->session->minor;
enum lttng_trace_chunk_status chunk_status;
const uint32_t connection_major = stream->trace->session->major;
const uint32_t connection_minor = stream->trace->session->minor;
enum lttng_trace_chunk_status chunk_status;
* If we never received a data file for the current stream, delay the
* opening, otherwise open it right now.
*/
* If we never received a data file for the current stream, delay the
* opening, otherwise open it right now.
*/
vstream->current_tracefile_id, NULL, file_path,
sizeof(file_path));
if (ret < 0) {
vstream->current_tracefile_id, NULL, file_path,
sizeof(file_path));
if (ret < 0) {
O_RDONLY, 0, &vstream->stream_file.handle,
true);
if (status != LTTNG_TRACE_CHUNK_STATUS_OK) {
O_RDONLY, 0, &vstream->stream_file.handle,
true);
if (status != LTTNG_TRACE_CHUNK_STATUS_OK) {
lseek_ret = fs_handle_seek(
vstream->index_file->file, 0, SEEK_END);
if (lseek_ret < 0) {
lseek_ret = fs_handle_seek(
vstream->index_file->file, 0, SEEK_END);
if (lseek_ret < 0) {
/* Globally visible after the add unique. */
lttng_ht_node_init_u64(&vstream->stream_n, stream->stream_handle);
urcu_ref_init(&vstream->ref);
/* Globally visible after the add unique. */
lttng_ht_node_init_u64(&vstream->stream_n, stream->stream_handle);
urcu_ref_init(&vstream->ref);