summaryrefslogtreecommitdiff
path: root/Kernel/TTY
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-05-09 12:30:51 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-09 12:30:51 +0200
commit9c927538ad81a9253c43509bcb7479998a50b7fa (patch)
tree28ab19d67591e98de360760705677bf04525a406 /Kernel/TTY
parenta0616d96bfa5ce3412c3e404316d4af13fbe6294 (diff)
downloadserenity-9c927538ad81a9253c43509bcb7479998a50b7fa.zip
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.
Diffstat (limited to 'Kernel/TTY')
-rw-r--r--Kernel/TTY/TTY.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Kernel/TTY/TTY.cpp b/Kernel/TTY/TTY.cpp
index 0ec94e2d70..f2215a7782 100644
--- a/Kernel/TTY/TTY.cpp
+++ b/Kernel/TTY/TTY.cpp
@@ -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);