From 05972668d14ac0b4fb3410f7a9d0cef3ab2a89d6 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Thu, 6 Aug 2020 03:22:06 +0430 Subject: [PATCH] Kernel: Send a SIGCHLD to the parent upon suspension of a process ...that is controlling a TTY. --- Kernel/TTY/TTY.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Kernel/TTY/TTY.cpp b/Kernel/TTY/TTY.cpp index 1743bf86d2..bc9ff14ff3 100644 --- a/Kernel/TTY/TTY.cpp +++ b/Kernel/TTY/TTY.cpp @@ -155,6 +155,10 @@ void TTY::emit(u8 ch) if (ch == m_termios.c_cc[VSUSP]) { dbg() << tty_name() << ": VSUSP pressed!"; generate_signal(SIGTSTP); + if (auto process = Process::from_pid(m_pgid)) { + if (auto parent = Process::from_pid(process->ppid())) + (void)parent->send_signal(SIGCHLD, process); + } return; } } @@ -390,5 +394,4 @@ void TTY::hang_up() { generate_signal(SIGHUP); } - }