lkml.org 
[lkml]   [2008]   [Dec]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 2/7][v4] Protect init from unwanted signals more
On 12/24, Sukadev Bhattiprolu wrote:
>
> -static int sig_ignored(struct task_struct *t, int sig)
> +static int sig_task_ignored(struct task_struct *t, int sig)
> {
> void __user *handler;
>
> + handler = sig_handler(t, sig);
> +
> + if (unlikely(t->signal->flags & SIGNAL_UNKILLABLE) &&
> + (handler == SIG_IGN || handler == SIG_DFL))
> + return 1;
> +
> + return sig_handler_ignored(handler, sig);

Well, really minor nit, but can't resist ;)

if we check both SIG_IGN and SIG_DFL, then why do we call
sig_handler_ignored() ? We can do

if (unlikely(t->signal->flags & SIGNAL_UNKILLABLE))
return handler == SIG_IGN || handler == SIG_DFL;
return sig_handler_ignored(handler, sig);

Or, we can do

if (unlikely(t->signal->flags & SIGNAL_UNKILLABLE) &&
handler == SIG_DFL)
return 1;
return sig_handler_ignored(handler, sig);

because sig_handler_ignored() checks SIG_IGN too.

Of course, this is a matter of taste only...

Oleg.



\
 
 \ /
  Last update: 2008-12-24 17:39    [W:0.084 / U:0.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site