]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf: don't send ttys when none are configured
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 4 Sep 2017 12:35:02 +0000 (14:35 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 4 Sep 2017 16:38:01 +0000 (18:38 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/conf.c

index 05fb8e54ec15e4474139e9cbf3f770ba1b79c7b9..041cc36054903342742358eeaae485fb7e39cc4e 100644 (file)
@@ -3011,6 +3011,9 @@ static int lxc_send_ttys_to_parent(struct lxc_handler *handler)
        int sock = handler->data_sock[0];
        int ret = -1;
 
+       if (!conf->tty)
+               return 0;
+
        for (i = 0; i < conf->tty; i++) {
                int ttyfds[2];
                struct lxc_pty_info *pty_info = &tty_info->pty_info[i];