[lxc-devel] the lxc.tty option leaks file descriptors

Môshe van der Sterre me at moshe.nl
Wed Apr 8 20:42:56 UTC 2009


Hello again,

I noticed extra open file descriptors in the container when using lxc.tty.
This patch seems to fix it, is this the correct approach?

Greetings,
Môshe van der Sterre

P.S. I'm trying to build a product based on LXC,
I hope you don't mind me submitting random patches. :-)

diff --git a/src/lxc/start.c b/src/lxc/start.c
index de355af..34ca4f5 100644
--- a/src/lxc/start.c
+++ b/src/lxc/start.c
@@ -350,6 +350,9 @@ int lxc_start(const char *name, char *argv[])
 
                close(sv[1]);
 
+                /* The child does not need the tty file descriptors */
+               lxc_delete_tty(&tty_info);
+
                /* Be sure we don't inherit this after the exec */
                fcntl(sv[0], F_SETFD, FD_CLOEXEC);
                





More information about the lxc-devel mailing list