From: Mathieu Desnoyers Date: Thu, 22 Aug 2019 17:06:22 +0000 (-0700) Subject: Fix: relayd: create_index_file error handling X-Git-Tag: v2.11.0-rc3~37 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ac67824cc4d4e2defaf88f34cc2518ca8dd5ce34;p=lttng-tools.git Fix: relayd: create_index_file error handling Fix mixup between status and 0/-1 return value; Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-relayd/stream.c b/src/bin/lttng-relayd/stream.c index d11e436a9..043d19612 100644 --- a/src/bin/lttng-relayd/stream.c +++ b/src/bin/lttng-relayd/stream.c @@ -383,6 +383,7 @@ static int create_index_file(struct relay_stream *stream, int ret; uint32_t major, minor; char *index_subpath = NULL; + enum lttng_trace_chunk_status status; ASSERT_LOCKED(stream->lock); @@ -404,10 +405,11 @@ static int create_index_file(struct relay_stream *stream, goto end; } - ret = lttng_trace_chunk_create_subdirectory(chunk, + status = lttng_trace_chunk_create_subdirectory(chunk, index_subpath); free(index_subpath); - if (ret) { + if (status != LTTNG_TRACE_CHUNK_STATUS_OK) { + ret = -1; goto end; } stream->index_file = lttng_index_file_create_from_trace_chunk(