signal: Push pid type down into send_signal
This information is already available in the callers and by pushing it down it makes the code a little clearer, and allows better group signal behavior in fork. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
This commit is contained in:
Родитель
40b3b02535
Коммит
b213984bd3
|
@ -1103,7 +1103,7 @@ ret:
|
||||||
}
|
}
|
||||||
|
|
||||||
static int send_signal(int sig, struct siginfo *info, struct task_struct *t,
|
static int send_signal(int sig, struct siginfo *info, struct task_struct *t,
|
||||||
int group)
|
enum pid_type type)
|
||||||
{
|
{
|
||||||
int from_ancestor_ns = 0;
|
int from_ancestor_ns = 0;
|
||||||
|
|
||||||
|
@ -1112,7 +1112,7 @@ static int send_signal(int sig, struct siginfo *info, struct task_struct *t,
|
||||||
!task_pid_nr_ns(current, task_active_pid_ns(t));
|
!task_pid_nr_ns(current, task_active_pid_ns(t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return __send_signal(sig, info, t, group, from_ancestor_ns);
|
return __send_signal(sig, info, t, type != PIDTYPE_PID, from_ancestor_ns);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_fatal_signal(int signr)
|
static void print_fatal_signal(int signr)
|
||||||
|
@ -1151,13 +1151,13 @@ __setup("print-fatal-signals=", setup_print_fatal_signals);
|
||||||
int
|
int
|
||||||
__group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
|
__group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
|
||||||
{
|
{
|
||||||
return send_signal(sig, info, p, 1);
|
return send_signal(sig, info, p, PIDTYPE_TGID);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
specific_send_sig_info(int sig, struct siginfo *info, struct task_struct *t)
|
specific_send_sig_info(int sig, struct siginfo *info, struct task_struct *t)
|
||||||
{
|
{
|
||||||
return send_signal(sig, info, t, 0);
|
return send_signal(sig, info, t, PIDTYPE_PID);
|
||||||
}
|
}
|
||||||
|
|
||||||
int do_send_sig_info(int sig, struct siginfo *info, struct task_struct *p,
|
int do_send_sig_info(int sig, struct siginfo *info, struct task_struct *p,
|
||||||
|
@ -1167,7 +1167,7 @@ int do_send_sig_info(int sig, struct siginfo *info, struct task_struct *p,
|
||||||
int ret = -ESRCH;
|
int ret = -ESRCH;
|
||||||
|
|
||||||
if (lock_task_sighand(p, &flags)) {
|
if (lock_task_sighand(p, &flags)) {
|
||||||
ret = send_signal(sig, info, p, type != PIDTYPE_PID);
|
ret = send_signal(sig, info, p, type);
|
||||||
unlock_task_sighand(p, &flags);
|
unlock_task_sighand(p, &flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3966,7 +3966,7 @@ void kdb_send_sig(struct task_struct *t, int sig)
|
||||||
"the deadlock.\n");
|
"the deadlock.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ret = send_signal(sig, SEND_SIG_PRIV, t, false);
|
ret = send_signal(sig, SEND_SIG_PRIV, t, PIDTYPE_PID);
|
||||||
spin_unlock(&t->sighand->siglock);
|
spin_unlock(&t->sighand->siglock);
|
||||||
if (ret)
|
if (ret)
|
||||||
kdb_printf("Fail to deliver Signal %d to process %d.\n",
|
kdb_printf("Fail to deliver Signal %d to process %d.\n",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче