]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Init "busy" field to -1 as 0 is valid fd
authorRachid Koucha <47061324+Rachid-Koucha@users.noreply.github.com>
Fri, 6 Dec 2019 13:59:52 +0000 (14:59 +0100)
committerGitHub <noreply@github.com>
Fri, 6 Dec 2019 13:59:52 +0000 (14:59 +0100)
"busy" field is assigned with the command socket descriptor when the terminal is in use. So, use "-1" to disable it.
Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
src/lxc/start.c

index 6e2f0ab046de85f286eec55a8f9568c1b6c22c85..de564291f8d24d90dae5e3b4fda74ed84f40c252 100644 (file)
@@ -1526,11 +1526,11 @@ static int lxc_recv_ttys_from_child(struct lxc_handler *handler)
                        break;
 
                tty = &ttys->tty[i];
-               tty->busy = 0;
+               tty->busy = -1;
                tty->master = ttyfds[0];
                tty->slave = ttyfds[1];
                TRACE("Received pty with master fd %d and slave fd %d from "
-                     "parent", tty->master, tty->slave);
+                     "child", tty->master, tty->slave);
        }
 
        if (ret < 0)