X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fust-consumer%2Fust-consumer.c;h=3731cbb26b527c4deb1621de5bf3f84051007a20;hb=13886d2d433762b7cf54f8e812f747ec2829de57;hp=031a7cb261a52fa8d6b0c4c53be291be5896b973;hpb=ea88ca2a0b3fa898e245893c43ae2185da0acc44;p=lttng-tools.git diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index 031a7cb26..3731cbb26 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -189,9 +189,9 @@ static int send_stream_to_thread(struct lttng_consumer_stream *stream, /* Get the right pipe where the stream will be sent. */ if (stream->metadata_flag) { - stream_pipe = ctx->consumer_metadata_pipe[1]; + stream_pipe = lttng_pipe_get_writefd(ctx->consumer_metadata_pipe); } else { - stream_pipe = ctx->consumer_data_pipe[1]; + stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); } do { @@ -278,6 +278,12 @@ static int create_ust_streams(struct lttng_consumer_channel *channel, */ 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.