Commit 3db989ba by Qiang Huang Committed by Serge Hallyn

lxc-console: use fd instead of 0 in setup_tios

We should use the fd specified by caller. Signed-off-by: 's avatarQiang Huang <h.huangqiang@huawei.com> Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
parent dc5e436e
...@@ -109,7 +109,7 @@ static int setup_tios(int fd, struct termios *newtios, struct termios *oldtios) ...@@ -109,7 +109,7 @@ static int setup_tios(int fd, struct termios *newtios, struct termios *oldtios)
} }
/* Get current termios */ /* Get current termios */
if (tcgetattr(0, oldtios)) { if (tcgetattr(fd, oldtios)) {
SYSERROR("failed to get current terminal settings"); SYSERROR("failed to get current terminal settings");
return -1; return -1;
} }
...@@ -125,7 +125,7 @@ static int setup_tios(int fd, struct termios *newtios, struct termios *oldtios) ...@@ -125,7 +125,7 @@ static int setup_tios(int fd, struct termios *newtios, struct termios *oldtios)
newtios->c_cc[VTIME] = 0; newtios->c_cc[VTIME] = 0;
/* Set new attributes */ /* Set new attributes */
if (tcsetattr(0, TCSAFLUSH, newtios)) { if (tcsetattr(fd, TCSAFLUSH, newtios)) {
ERROR("failed to set new terminal settings"); ERROR("failed to set new terminal settings");
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment