Fix: relayd: create_index_file error handling
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 22 Aug 2019 17:06:22 +0000 (10:06 -0700)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 5 Sep 2019 00:00:57 +0000 (20:00 -0400)
Fix mixup between status and 0/-1 return value;

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/stream.c

index d11e436a9587019c54920841013fb9fad249088c..043d19612ce0489efffad2b1f99fc1c8be52e98d 100644 (file)
@@ -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(
This page took 0.028263 seconds and 5 git commands to generate.