]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-attach: setup ts->stdoutfd 863/head
authorChristian Brauner <christian.brauner@mailbox.org>
Tue, 1 Mar 2016 22:05:59 +0000 (23:05 +0100)
committerChristian Brauner <christian.brauner@mailbox.org>
Tue, 1 Mar 2016 22:11:04 +0000 (23:11 +0100)
Otherwise we cannot do things like:

- lxc-attach -n a runlevel </dev/null
- lxc-attach -n a runlevel </dev/null 2>/dev/null
- lxc-attach -n a runlevel </dev/null 2>/dev/null | cat

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
src/lxc/lxc_attach.c

index b6b78244b995eade9f479e0f7fcc3fc452d6c5e4..348014d96207d7a8e59777e3e4f42bf571d1c4cd 100644 (file)
@@ -273,6 +273,7 @@ static int get_pty_on_host(struct lxc_container *c, struct wrapargs *wrap, int *
        if (lxc_console_create(conf) < 0)
                return -1;
        ts = conf->console.tty_state;
+       ts->stdoutfd = STDOUT_FILENO;
        conf->console.descr = &descr;
 
        /* Shift ttys to container. */