if (stream->metadata_flag) {
stream_pipe = ctx->consumer_metadata_pipe[1];
} else {
- stream_pipe = ctx->consumer_data_pipe[1];
+ stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe);
}
do {
*/
stream->wait_fd = wait_fd;
+ /*
+ * Increment channel refcount since the channel reference has now been
+ * assigned in the allocation process above.
+ */
+ uatomic_inc(&stream->chan->refcount);
+
/*
* Order is important this is why a list is used. On error, the caller
* should clean this list.