lkml.org 
[lkml]   [2023]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] signal: Fix the error return of kill -1
Oleg Nesterov <oleg@redhat.com> writes:

> On 08/15, David Laight wrote:
>>
>> 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;
>
> Hmm, indeed ;)
>
> and "err" can be declared inside the loop.

We can't remove the success case, from my posted patch.

A signal is considered as successfully delivered if at least
one process receives it.

That is something the current code for kill -1 actually gets
wrong (but hides because it ignores -EPERM).

Otherwise yes I expect we can simplify the use of variables as
suggested.

Eric

\
 
 \ /
  Last update: 2023-08-16 22:34    [W:0.157 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site