]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Don't close fd 0, fd 1
authorDaniel Lezcano <daniel.lezcano@free.fr>
Wed, 19 May 2010 20:15:28 +0000 (22:15 +0200)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Wed, 19 May 2010 20:15:28 +0000 (22:15 +0200)
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 <dlezcano@fr.ibm.com>
src/lxc/conf.c
src/lxc/start.c

index a0c7a7c4a71255298528887a6857644f6a0a8e50..e7c93c0ed899de68a411df46c6206a48a504675b 100644 (file)
@@ -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);
index b3a8bb4bbe26256d40e998d00181ef152fe5c339..5924c1436e3ee973f52f70b734f7612cb20bde61 100644 (file)
@@ -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");