2003-02-11 09:46:55

by Andries E. Brouwer

[permalink] [raw]
Subject: [PATCH] signal error return fix

diff -u --recursive --new-file -X /linux/dontdiff a/kernel/sys.c b/kernel/sys.c
--- a/kernel/sys.c Tue Feb 11 09:14:18 2003
+++ b/kernel/sys.c Tue Feb 11 10:13:26 2003
@@ -916,6 +916,7 @@
p = find_task_by_pid(pid);
if (!p)
goto out;
+
err = -EINVAL;
if (!thread_group_leader(p))
goto out;
@@ -927,11 +928,16 @@
err = -EACCES;
if (p->did_exec)
goto out;
- } else if (p != current)
- goto out;
+ } else {
+ err = -ESRCH;
+ if (p != current)
+ goto out;
+ }
+
err = -EPERM;
if (p->leader)
goto out;
+
if (pgid != pid) {
struct task_struct *p;
struct pid *pid;