From 5c2940600e301a62dbf8fac3ed00f466003bdadb Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Mon, 10 May 2010 11:50:09 +0200 Subject: [PATCH] Fix console infinite loop When the client console exits, the mainloop goes in an infinite loop as the handler is not removed and we are notified from the disconnection indefinitely. Signed-off-by: Daniel Lezcano --- src/lxc/console.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lxc/console.c b/src/lxc/console.c index f40fb0be2..123dc31d8 100644 --- a/src/lxc/console.c +++ b/src/lxc/console.c @@ -237,6 +237,13 @@ static int console_handler(int fd, void *data, struct lxc_epoll_descr *descr) return 1; } + if (!r) { + INFO("console client has exited"); + lxc_mainloop_del_handler(descr, fd); + close(fd); + return 0; + } + /* no output for the console, do nothing */ if (console->peer == -1) return 0; -- 2.47.2