Use tcflush(3) instead of (nonstandard) TIOCFLUSH.
Reported by: kib MFC after: 2 weeks Sponsored by: DARPA, AFRL
This commit is contained in:
parent
3c94c307c5
commit
f42f7c5191
@ -52,7 +52,7 @@ main(__unused int argc, __unused char **argv)
|
||||
{
|
||||
struct termios old, new;
|
||||
struct winsize w;
|
||||
int ret, fd, cnt, error, what;
|
||||
int ret, fd, cnt, error;
|
||||
char data[20];
|
||||
struct timeval then, now;
|
||||
|
||||
@ -72,10 +72,9 @@ main(__unused int argc, __unused char **argv)
|
||||
exit(1);
|
||||
|
||||
/* Discard input received so far */
|
||||
what = FREAD | FWRITE;
|
||||
error = ioctl(fd, TIOCFLUSH, &what);
|
||||
error = tcflush(fd, TCIOFLUSH);
|
||||
if (error != 0)
|
||||
warn("ioctl");
|
||||
warn("tcflush");
|
||||
|
||||
if (write(fd, query, sizeof(query)) != sizeof(query)) {
|
||||
error = 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user