From: Qiang Huang Date: Mon, 27 May 2013 11:10:38 +0000 (+0800) Subject: lxc-console: use fd instead of 0 in setup_tios X-Git-Tag: lxc-1.0.0.alpha1~1^2~178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3db989bad5d58bafac80f448e1dd2d048e791478;p=thirdparty%2Flxc.git lxc-console: use fd instead of 0 in setup_tios We should use the fd specified by caller. Signed-off-by: Qiang Huang Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/lxc_console.c b/src/lxc/lxc_console.c index 820794ab9..688de8070 100644 --- a/src/lxc/lxc_console.c +++ b/src/lxc/lxc_console.c @@ -109,7 +109,7 @@ static int setup_tios(int fd, struct termios *newtios, struct termios *oldtios) } /* Get current termios */ - if (tcgetattr(0, oldtios)) { + if (tcgetattr(fd, oldtios)) { SYSERROR("failed to get current terminal settings"); return -1; } @@ -125,7 +125,7 @@ static int setup_tios(int fd, struct termios *newtios, struct termios *oldtios) newtios->c_cc[VTIME] = 0; /* Set new attributes */ - if (tcsetattr(0, TCSAFLUSH, newtios)) { + if (tcsetattr(fd, TCSAFLUSH, newtios)) { ERROR("failed to set new terminal settings"); return -1; }