From: Rachid Koucha <47061324+Rachid-Koucha@users.noreply.github.com> Date: Fri, 6 Dec 2019 13:59:52 +0000 (+0100) Subject: Init "busy" field to -1 as 0 is valid fd X-Git-Tag: lxc-4.0.0~80^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd3de5683d8db869c962c23e9a48f57220888c2f;p=thirdparty%2Flxc.git Init "busy" field to -1 as 0 is valid fd "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 --- diff --git a/src/lxc/start.c b/src/lxc/start.c index 6e2f0ab04..de564291f 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -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)