Kernel: Only send SIGTTOU if TTY termios has TOSTOP flag

Fixes #4909
This commit is contained in:
Andreas Kling 2021-01-11 22:40:40 +01:00
parent e5234f9560
commit a0506cb39e

View file

@ -103,7 +103,7 @@ KResultOr<size_t> TTY::read(FileDescription&, size_t, UserOrKernelBuffer& buffer
KResultOr<size_t> TTY::write(FileDescription&, size_t, const UserOrKernelBuffer& buffer, size_t size)
{
if (Process::current()->pgid() != pgid()) {
if (m_termios.c_lflag & TOSTOP && Process::current()->pgid() != pgid()) {
[[maybe_unused]] auto rc = Process::current()->send_signal(SIGTTOU, nullptr);
return KResult(-EINTR);
}