mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-12 18:55:09 +00:00
Kernel: Send SIGCHLD to the thread with same PID as my PPID
Instead of delivering SIGCHLD to "any thread" in the process with PPID, send it to the thread with the same TID as my PPID.
This commit is contained in:
@@ -2611,13 +2611,12 @@ void Process::finalize()
|
||||
disown_all_shared_buffers();
|
||||
{
|
||||
InterruptDisabler disabler;
|
||||
if (auto* parent_process = Process::from_pid(m_ppid)) {
|
||||
// FIXME(Thread): What should we do here? Should we look at all threads' signal actions?
|
||||
if (parent_process->thread_count() && parent_process->any_thread().m_signal_action_data[SIGCHLD].flags & SA_NOCLDWAIT) {
|
||||
if (auto* parent_thread = Thread::from_tid(m_ppid)) {
|
||||
if (parent_thread->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);
|
||||
parent_thread->send_signal(SIGCHLD, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user