]> 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)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sat, 7 Dec 2019 15:50:37 +0000 (16:50 +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 5fa8852f5a5ade1cd825431e3aadbc29bc8c0887..b496b93138eef0dec24a1b73ef124b116ddb7ed2 100644 (file)
@@ -1489,11 +1489,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)