Commit 3a948de7 authored by Linus Torvalds's avatar Linus Torvalds

Fix kill_pg_info(): return success if _any_ signal succeeded.

parent 5adf0d58
...@@ -1071,23 +1071,19 @@ int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp) ...@@ -1071,23 +1071,19 @@ int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp)
struct task_struct *p; struct task_struct *p;
struct list_head *l; struct list_head *l;
struct pid *pid; struct pid *pid;
int retval; int retval, success;
int found;
if (pgrp <= 0) if (pgrp <= 0)
return -EINVAL; return -EINVAL;
found = 0; success = 0;
retval = 0; retval = -ESRCH;
for_each_task_pid(pgrp, PIDTYPE_PGID, p, l, pid) { for_each_task_pid(pgrp, PIDTYPE_PGID, p, l, pid) {
int err; int err = group_send_sig_info(sig, info, p);
success |= !err;
found = 1; retval = err;
err = group_send_sig_info(sig, info, p);
if (!retval)
retval = err;
} }
return found ? retval : -ESRCH; return success ? 0 : retval;
} }
int int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment