From e8b3ee81555c47ce5511363361493ccfc8884031 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 28 Aug 2007 14:24:34 +0000 Subject: [PATCH] SIGCHLD also needs to be sent when a child is stopped. The shell now properly realized when a job has been stopped. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22093 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/signal.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/system/kernel/signal.cpp b/src/system/kernel/signal.cpp index 5ffb247c80..63b1e3f39e 100644 --- a/src/system/kernel/signal.cpp +++ b/src/system/kernel/signal.cpp @@ -51,6 +51,10 @@ const char * const sigstr[NSIG] = { }; +static status_t deliver_signal(struct thread *thread, uint signal, + uint32 flags); + + static bool notify_debugger(struct thread *thread, int signal, struct sigaction *handler, bool deadly) @@ -72,10 +76,9 @@ notify_debugger(struct thread *thread, int signal, struct sigaction *handler, } -/** Actually handles the signal - ie. the thread will exit, a custom signal - * handler is prepared, or whatever the signal demands. - */ - +/*! Actually handles the signal - ie. the thread will exit, a custom signal + handler is prepared, or whatever the signal demands. +*/ bool handle_signals(struct thread *thread) { @@ -172,6 +175,11 @@ handle_signals(struct thread *thread) InterruptsSpinLocker locker(team_spinlock); team_set_job_control_state(thread->team, JOB_CONTROL_STATE_STOPPED, signal, false); + + // send a SIGCHLD to the parent + SpinLocker _(thread_spinlock); + deliver_signal(thread->team->parent->main_thread, + SIGCHLD, 0); } continue;