From: Daniel Lezcano Date: Mon, 10 May 2010 09:50:09 +0000 (+0200) Subject: Fix console infinite loop X-Git-Tag: lxc-0.7.0~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c2940600e301a62dbf8fac3ed00f466003bdadb;p=thirdparty%2Flxc.git 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 --- 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;