From 1273dcaaae48f586addbd0e5715f1fe07360b7b5 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 28 Aug 2007 21:34:05 +0000 Subject: [PATCH] Respect SA_NOCLDSTOP. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22101 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/signal.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/system/kernel/signal.cpp b/src/system/kernel/signal.cpp index 63b1e3f39e..8ac3bba25f 100644 --- a/src/system/kernel/signal.cpp +++ b/src/system/kernel/signal.cpp @@ -155,6 +155,10 @@ handle_signals(struct thread *thread) InterruptsSpinLocker locker(team_spinlock); team_set_job_control_state(thread->team, JOB_CONTROL_STATE_CONTINUED, signal, false); + + // The standard states that the system *may* send a + // SIGCHLD when a child is continued. I haven't found + // a good reason why we would want to, though. } continue; @@ -176,10 +180,15 @@ handle_signals(struct thread *thread) team_set_job_control_state(thread->team, JOB_CONTROL_STATE_STOPPED, signal, false); - // send a SIGCHLD to the parent + // send a SIGCHLD to the parent (if it does have + // SA_NOCLDSTOP defined) SpinLocker _(thread_spinlock); - deliver_signal(thread->team->parent->main_thread, - SIGCHLD, 0); + struct thread* parentThread + = thread->team->parent->main_thread; + struct sigaction& parentHandler + = parentThread->sig_action[SIGCHLD - 1]; + if ((parentHandler.sa_flags & SA_NOCLDSTOP) == 0) + deliver_signal(parentThread, SIGCHLD, 0); } continue;