Make sure wait/wakeup stream and channel FDs are closed at teardown.
This led to FD leaks on the consumer daemon when the relay daemon
disconnects unexpectedly.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
void ustctl_destroy_channel(struct ustctl_consumer_channel *chan)
{
+ (void) ustctl_channel_close_wait_fd(chan);
+ (void) ustctl_channel_close_wakeup_fd(chan);
chan->chan->ops->channel_destroy(chan->chan);
free(chan);
}
assert(stream);
buf = stream->buf;
consumer_chan = stream->chan;
+ (void) ustctl_stream_close_wait_fd(stream);
+ (void) ustctl_stream_close_wakeup_fd(stream);
lib_ring_buffer_release_read(buf, consumer_chan->chan->handle);
free(stream);
}