From ee77a7b0829d9976d3a899cfc9847f83e042ecc9 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 3 Nov 2011 19:18:51 -0400 Subject: [PATCH] ust consumer: fix double close Signed-off-by: Mathieu Desnoyers --- liblttng-ustconsumer/lttng-ustconsumer.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/liblttng-ustconsumer/lttng-ustconsumer.c b/liblttng-ustconsumer/lttng-ustconsumer.c index 3c81c32e7..bf3ae0845 100644 --- a/liblttng-ustconsumer/lttng-ustconsumer.c +++ b/liblttng-ustconsumer/lttng-ustconsumer.c @@ -271,6 +271,12 @@ int lttng_ustconsumer_allocate_channel(struct lttng_consumer_channel *chan) if (!chan->handle) { return -ENOMEM; } + /* + * The channel shm and wait fds are passed to ustctl, set them + * to -1 here. + */ + chan->shm_fd = -1; + chan->wait_fd = -1; return 0; } @@ -298,6 +304,13 @@ int lttng_ustconsumer_allocate_stream(struct lttng_consumer_stream *stream) if (!stream->mmap_base) { return -EINVAL; } + /* + * The stream shm and wait fds are passed to ustctl, set them to + * -1 here. + */ + stream->shm_fd = -1; + stream->wait_fd = -1; + return 0; } -- 2.34.1