mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +00:00
Kernel: Don't send SIGCHLD to parent process if he has SA_NOCLDWAIT set.
Just transfer ownership of the dead process to the colonel and let the scheduler reap it on next iteration.
This commit is contained in:
@@ -2202,7 +2202,12 @@ void Process::finalize()
|
||||
{
|
||||
InterruptDisabler disabler;
|
||||
if (auto* parent_process = Process::from_pid(m_ppid)) {
|
||||
parent_process->send_signal(SIGCHLD, this);
|
||||
if (parent_process->m_signal_action_data[SIGCHLD].flags & SA_NOCLDWAIT) {
|
||||
// NOTE: If the parent doesn't care about this process, let it go.
|
||||
m_ppid = 0;
|
||||
} else {
|
||||
parent_process->send_signal(SIGCHLD, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user