Use tcflush(3) instead of TIOCFLUSH, from Ed Schouten.

pull/1/head
Nicholas Marriott 2010-01-01 14:29:18 +00:00
parent a775107f5f
commit 9ee979167a
1 changed files with 2 additions and 5 deletions

7
tty.c
View File

@ -146,7 +146,7 @@ void
tty_start_tty(struct tty *tty) tty_start_tty(struct tty *tty)
{ {
struct termios tio; struct termios tio;
int what, mode; int mode;
if (tty->fd == -1) if (tty->fd == -1)
return; return;
@ -170,10 +170,7 @@ tty_start_tty(struct tty *tty)
tio.c_cc[VTIME] = 0; tio.c_cc[VTIME] = 0;
if (tcsetattr(tty->fd, TCSANOW, &tio) != 0) if (tcsetattr(tty->fd, TCSANOW, &tio) != 0)
fatal("tcsetattr failed"); fatal("tcsetattr failed");
tcflush(tty->fd, TCIOFLUSH);
what = 0;
if (ioctl(tty->fd, TIOCFLUSH, &what) != 0)
fatal("ioctl(TIOCFLUSH)");
tty_putcode(tty, TTYC_SMCUP); tty_putcode(tty, TTYC_SMCUP);