Kernel: Send a SIGCHLD to the parent upon suspension of a process
...that is controlling a TTY.
This commit is contained in:
parent
b3d1a05261
commit
05972668d1
Notes:
sideshowbarker
2024-07-19 04:14:11 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/05972668d14 Pull-request: https://github.com/SerenityOS/serenity/pull/3020 Reviewed-by: https://github.com/awesomekling
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue