Kernel: ioctl(TCSETSF) on a TTY should flush input

This is where we end up when calling tcsetattr() with TCSAFLUSH.
This fixes vttest not accepting the first keystroke as input.
This commit is contained in:
Andreas Kling 2020-05-09 12:30:51 +02:00
parent a0616d96bf
commit 9c927538ad
Notes: sideshowbarker 2024-07-19 06:49:04 +09:00

View File

@ -326,6 +326,8 @@ int TTY::ioctl(FileDescription&, unsigned request, unsigned arg)
if (!process.validate_read(tp, sizeof(termios)))
return -EFAULT;
set_termios(*tp);
if (request == TCSETSF)
flush_input();
return 0;
case TIOCGWINSZ:
ws = reinterpret_cast<winsize*>(arg);