From: Daniel Lezcano Date: Wed, 19 May 2010 20:15:28 +0000 (+0200) Subject: Don't close fd 0, fd 1 X-Git-Tag: lxc-0.7.0~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5332bb844a521401cf465cc8a2c8b52c7b9af82a;p=thirdparty%2Flxc.git Don't close fd 0, fd 1 That breaks the reboot because when we reexec, fd 0 and fd 1 will be closed and these one are created by lxc, not inherited. Signed-off-by: Daniel Lezcano --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index a0c7a7c4a..e7c93c0ed 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -1373,6 +1373,9 @@ int lxc_create_tty(const char *name, struct lxc_conf *conf) return -1; } + DEBUG("allocated pty '%s' (%d/%d)", + pty_info->name, pty_info->master, pty_info->slave); + /* Prevent leaking the file descriptors to the container */ fcntl(pty_info->master, F_SETFD, FD_CLOEXEC); fcntl(pty_info->slave, F_SETFD, FD_CLOEXEC); diff --git a/src/lxc/start.c b/src/lxc/start.c index b3a8bb4bb..5924c1436 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -600,10 +600,6 @@ int lxc_start(const char *name, char *const argv[], struct lxc_conf *conf) goto out_fini; } - /* no need of other inherited fds but stderr */ - close(fileno(stdin)); - close(fileno(stdout)); - err = lxc_poll(name, handler); if (err) { ERROR("mainloop exited with an error");