X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fconsumer.c;h=5ca2e7bad68187f7b61b628a28ae0932658a3ccb;hb=e43c41c57a0087c782ca0ec29d6613364605d31d;hp=044a504cec512443039e15eac186df07e841f896;hpb=13886d2d433762b7cf54f8e812f747ec2829de57;p=lttng-tools.git diff --git a/src/common/consumer.c b/src/common/consumer.c index 044a504ce..5ca2e7bad 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -463,6 +463,13 @@ void consumer_del_stream(struct lttng_consumer_stream *stream, PERROR("munmap"); } } + + if (stream->wait_fd >= 0) { + ret = close(stream->wait_fd); + if (ret) { + PERROR("close"); + } + } break; case LTTNG_CONSUMER32_UST: case LTTNG_CONSUMER64_UST: @@ -899,7 +906,7 @@ int consumer_add_channel(struct lttng_consumer_channel *channel, /* Channel already exist. Ignore the insertion */ ERR("Consumer add channel key %" PRIu64 " already exists!", channel->key); - ret = -1; + ret = LTTNG_ERR_KERN_CHAN_EXIST; goto end; } @@ -1876,6 +1883,13 @@ void consumer_del_metadata_stream(struct lttng_consumer_stream *stream, PERROR("munmap metadata stream"); } } + + if (stream->wait_fd >= 0) { + ret = close(stream->wait_fd); + if (ret < 0) { + PERROR("close kernel metadata wait_fd"); + } + } break; case LTTNG_CONSUMER32_UST: case LTTNG_CONSUMER64_UST: