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:
Martin Lund 2014-10-23 10:54:23 +02:00
parent 54e535d029
commit 7bef8f8a0d

View file

@ -157,6 +157,10 @@ int connect_tty(void)
exit(EXIT_FAILURE);
}
/* Flush stale I/O data (if any) */
tcflush(fd, TCIOFLUSH);
/* Print connect status */
color_printf("[gotty %s] Connected", current_time());
connected = true;
tainted = false;