2
0
mirror of git://github.com/lxc/lxc synced 2025-08-31 10:19:37 +00:00

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 <dlezcano@fr.ibm.com>
This commit is contained in:
Daniel Lezcano
2010-05-10 11:50:09 +02:00
committed by Daniel Lezcano
parent 82d89dce37
commit 5c2940600e

View File

@@ -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;