From: Jérémie Galarneau Date: Fri, 16 Dec 2016 08:10:00 +0000 (-0500) Subject: Assert that index_file does not exist before setting a new one X-Git-Tag: v2.10.0-rc1~84 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1b47ae5812ca04726890048e7ec9ce4186e4d590;p=lttng-tools.git Assert that index_file does not exist before setting a new one Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c index d03ff7015..bb5ba3b13 100644 --- a/src/common/kernel-consumer/kernel-consumer.c +++ b/src/common/kernel-consumer/kernel-consumer.c @@ -1485,6 +1485,7 @@ int lttng_kconsumer_on_recv_stream(struct lttng_consumer_stream *stream) if (!index_file) { goto error; } + assert(!stream->index_file); stream->index_file = index_file; } } diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index 82d56ebb7..5c7b00317 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -2630,6 +2630,7 @@ int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream) if (!index_file) { goto error; } + assert(!stream->index_file); stream->index_file = index_file; } }