From 9ee979167a433fe8a0fb76735cd220a37ee994f2 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 1 Jan 2010 14:29:18 +0000 Subject: [PATCH] Use tcflush(3) instead of TIOCFLUSH, from Ed Schouten. --- tty.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tty.c b/tty.c index a66c71a9..a84d8def 100644 --- a/tty.c +++ b/tty.c @@ -146,7 +146,7 @@ void tty_start_tty(struct tty *tty) { struct termios tio; - int what, mode; + int mode; if (tty->fd == -1) return; @@ -170,10 +170,7 @@ tty_start_tty(struct tty *tty) tio.c_cc[VTIME] = 0; if (tcsetattr(tty->fd, TCSANOW, &tio) != 0) fatal("tcsetattr failed"); - - what = 0; - if (ioctl(tty->fd, TIOCFLUSH, &what) != 0) - fatal("ioctl(TIOCFLUSH)"); + tcflush(tty->fd, TCIOFLUSH); tty_putcode(tty, TTYC_SMCUP);