aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/signal.c')
-rw-r--r--kernel/signal.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index 8259262eaa60..2a06f2441805 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -842,6 +842,7 @@ static inline int wants_signal(int sig, struct task_struct *p)
842static void 842static void
843__group_complete_signal(int sig, struct task_struct *p) 843__group_complete_signal(int sig, struct task_struct *p)
844{ 844{
845 struct signal_struct *signal = p->signal;
845 struct task_struct *t; 846 struct task_struct *t;
846 847
847 /* 848 /*
@@ -862,14 +863,14 @@ __group_complete_signal(int sig, struct task_struct *p)
862 /* 863 /*
863 * Otherwise try to find a suitable thread. 864 * Otherwise try to find a suitable thread.
864 */ 865 */
865 t = p->signal->curr_target; 866 t = signal->curr_target;
866 if (t == NULL) 867 if (t == NULL)
867 /* restart balancing at this thread */ 868 /* restart balancing at this thread */
868 t = p->signal->curr_target = p; 869 t = signal->curr_target = p;
869 870
870 while (!wants_signal(sig, t)) { 871 while (!wants_signal(sig, t)) {
871 t = next_thread(t); 872 t = next_thread(t);
872 if (t == p->signal->curr_target) 873 if (t == signal->curr_target)
873 /* 874 /*
874 * No thread needs to be woken. 875 * No thread needs to be woken.
875 * Any eligible threads will see 876 * Any eligible threads will see
@@ -877,14 +878,14 @@ __group_complete_signal(int sig, struct task_struct *p)
877 */ 878 */
878 return; 879 return;
879 } 880 }
880 p->signal->curr_target = t; 881 signal->curr_target = t;
881 } 882 }
882 883
883 /* 884 /*
884 * Found a killable thread. If the signal will be fatal, 885 * Found a killable thread. If the signal will be fatal,
885 * then start taking the whole group down immediately. 886 * then start taking the whole group down immediately.
886 */ 887 */
887 if (sig_fatal(p, sig) && !(p->signal->flags & SIGNAL_GROUP_EXIT) && 888 if (sig_fatal(p, sig) && !(signal->flags & SIGNAL_GROUP_EXIT) &&
888 !sigismember(&t->real_blocked, sig) && 889 !sigismember(&t->real_blocked, sig) &&
889 (sig == SIGKILL || !(t->ptrace & PT_PTRACED))) { 890 (sig == SIGKILL || !(t->ptrace & PT_PTRACED))) {
890 /* 891 /*
@@ -897,9 +898,9 @@ __group_complete_signal(int sig, struct task_struct *p)
897 * running and doing things after a slower 898 * running and doing things after a slower
898 * thread has the fatal signal pending. 899 * thread has the fatal signal pending.
899 */ 900 */
900 p->signal->flags = SIGNAL_GROUP_EXIT; 901 signal->flags = SIGNAL_GROUP_EXIT;
901 p->signal->group_exit_code = sig; 902 signal->group_exit_code = sig;
902 p->signal->group_stop_count = 0; 903 signal->group_stop_count = 0;
903 t = p; 904 t = p;
904 do { 905 do {
905 sigaddset(&t->pending.signal, SIGKILL); 906 sigaddset(&t->pending.signal, SIGKILL);