mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Flush I/O data on connect
Make sure there is no stale I/O data on tty device upon connect.
This commit is contained in:
parent
54e535d029
commit
7bef8f8a0d
1 changed files with 4 additions and 0 deletions
|
|
@ -157,6 +157,10 @@ int connect_tty(void)
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Flush stale I/O data (if any) */
|
||||||
|
tcflush(fd, TCIOFLUSH);
|
||||||
|
|
||||||
|
/* Print connect status */
|
||||||
color_printf("[gotty %s] Connected", current_time());
|
color_printf("[gotty %s] Connected", current_time());
|
||||||
connected = true;
|
connected = true;
|
||||||
tainted = false;
|
tainted = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue