[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3b14ae8091e3403bbc4ef1bee6dcf4f6@AcuMS.aculab.com>
Date: Tue, 15 Aug 2023 14:47:07 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Oleg Nesterov' <oleg@...hat.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>
CC: Petr Skocik <pskocik@...il.com>, Kees Cook <keescook@...omium.org>,
"Thomas Gleixner" <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
"Marco Elver" <elver@...gle.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] signal: Fix the error return of kill -1
From: Oleg Nesterov
> Sent: 14 August 2023 16:44
...
> Even simpler
>
> } else {
> struct task_struct * p;
> bool success = false;
> int err = -ESRCH;
int err;
ret = -ESRCH;
>
> for_each_process(p) {
> if (task_pid_vnr(p) > 1 &&
> !same_thread_group(p, current)) {
> err = group_send_sig_info(sig, info, p,
> PIDTYPE_MAX);
> success |= !err;
> }
> }
> ret = success ? 0 : err;
> }
or maybe even:
} else {
struct task_struct * p;
int err;
ret = -ESRCH;
for_each_process(p) {
if (task_pid_vnr(p) > 1 &&
!same_thread_group(p, current)) {
err = group_send_sig_info(sig, info, p,
PIDTYPE_MAX);
if (ret)
ret = err;
}
}
}
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists