X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fust-consumer%2Fust-consumer.c;h=e0280f1489e2e8defa25e1311023f4f518e4d666;hb=dae10966bfbb28474ae7162346237b249357e98c;hp=3731cbb26b527c4deb1621de5bf3f84051007a20;hpb=13886d2d433762b7cf54f8e812f747ec2829de57;p=lttng-tools.git diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index 3731cbb26..e0280f148 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -185,21 +185,21 @@ error: static int send_stream_to_thread(struct lttng_consumer_stream *stream, struct lttng_consumer_local_data *ctx) { - int ret, stream_pipe; + int ret; + struct lttng_pipe *stream_pipe; /* Get the right pipe where the stream will be sent. */ if (stream->metadata_flag) { - stream_pipe = lttng_pipe_get_writefd(ctx->consumer_metadata_pipe); + stream_pipe = ctx->consumer_metadata_pipe; } else { - stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); + stream_pipe = ctx->consumer_data_pipe; } - do { - ret = write(stream_pipe, &stream, sizeof(stream)); - } while (ret < 0 && errno == EINTR); + ret = lttng_pipe_write(stream_pipe, &stream, sizeof(stream)); if (ret < 0) { - PERROR("Consumer write %s stream to pipe %d", - stream->metadata_flag ? "metadata" : "data", stream_pipe); + ERR("Consumer write %s stream to pipe %d", + stream->metadata_flag ? "metadata" : "data", + lttng_pipe_get_writefd(stream_pipe)); } return ret;