X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fust-consumer%2Fust-consumer.c;h=bc0f585385814f1ba25be632f2a21fbd04232de9;hp=b558988dcf1a2ba4fcf6b6cabdff46c7166bbf25;hb=fe4477ee14abb348ce9e167f8b4c09312d67de36;hpb=6151a90fe7fa3dea52c57771df9083e56de7a60b diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index b558988dc..bc0f58538 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -38,6 +38,7 @@ #include #include #include +#include #include "ust-consumer.h" @@ -1283,10 +1284,28 @@ end: /* * Called when a stream is created. + * + * Return 0 on success or else a negative value. */ int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream) { - return lttng_create_output_file(stream); + int ret; + + /* Don't create anything if this is set for streaming. */ + if (stream->net_seq_idx == (uint64_t) -1ULL) { + ret = utils_create_stream_file(stream->chan->pathname, stream->name, + stream->chan->tracefile_size, stream->tracefile_count_current, + stream->uid, stream->gid); + if (ret < 0) { + goto error; + } + stream->out_fd = ret; + stream->tracefile_size_current = 0; + } + ret = 0; + +error: + return ret; } /*