X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fconsumer%2Fconsumer-stream.c;h=daed3866fc639bae297089831721d500d7f185c7;hb=ef440343c0d6372c1aaca74d0cdecfcd700a5785;hp=32441ea2cd313327cfacf22ab47772f6fea1d39f;hpb=d295668767ac8234e83984e1812d342d03293d88;p=lttng-tools.git diff --git a/src/common/consumer/consumer-stream.c b/src/common/consumer/consumer-stream.c index 32441ea2c..daed3866f 100644 --- a/src/common/consumer/consumer-stream.c +++ b/src/common/consumer/consumer-stream.c @@ -576,7 +576,7 @@ int consumer_stream_create_output_files(struct lttng_consumer_stream *stream, ret = utils_stream_file_path(stream->chan->pathname, stream->name, stream->chan->tracefile_size, - stream->chan->tracefile_count, NULL, + stream->tracefile_count_current, NULL, stream_path, sizeof(stream_path)); if (ret < 0) { goto end; @@ -594,7 +594,7 @@ int consumer_stream_create_output_files(struct lttng_consumer_stream *stream, DBG("Opening stream output file \"%s\"", stream_path); chunk_status = lttng_trace_chunk_open_file(stream->trace_chunk, stream_path, - flags, mode, &stream->out_fd); + flags, mode, &stream->out_fd, false); if (chunk_status != LTTNG_TRACE_CHUNK_STATUS_OK) { ERR("Failed to open stream file \"%s\"", stream->name); ret = -1; @@ -605,15 +605,15 @@ int consumer_stream_create_output_files(struct lttng_consumer_stream *stream, if (stream->index_file) { lttng_index_file_put(stream->index_file); } - stream->index_file = lttng_index_file_create_from_trace_chunk( + chunk_status = lttng_index_file_create_from_trace_chunk( stream->trace_chunk, stream->chan->pathname, stream->name, stream->chan->tracefile_size, stream->tracefile_count_current, CTF_INDEX_MAJOR, CTF_INDEX_MINOR, - false); - if (!stream->index_file) { + false, &stream->index_file); + if (chunk_status != LTTNG_TRACE_CHUNK_STATUS_OK) { ret = -1; goto end; } @@ -645,3 +645,13 @@ int consumer_stream_rotate_output_files(struct lttng_consumer_stream *stream) end: return ret; } + +bool consumer_stream_is_deleted(struct lttng_consumer_stream *stream) +{ + /* + * This function does not take a const stream since + * cds_lfht_is_node_deleted was not const before liburcu 0.12. + */ + assert(stream); + return cds_lfht_is_node_deleted(&stream->node.node); +}