diff options
| author | Daniel Jacobowitz <drow@nevyn.them.org> | 2003-02-15 12:30:25 -0500 |
|---|---|---|
| committer | Daniel Jacobowitz <drow@nevyn.them.org> | 2003-02-15 12:30:25 -0500 |
| commit | fd44ae6845e56ca7ac3435e2ec3ad984d9b7a4b7 (patch) | |
| tree | d094716e15c51760dbb4658c80896350c837e1df /kernel | |
| parent | fb585be332de120cf51fcc8d6e55022dc91f3010 (diff) | |
Clean up ptrace_setoptions and PT_* constants
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/exit.c | 6 | ||||
| -rw-r--r-- | kernel/ptrace.c | 25 | ||||
| -rw-r--r-- | kernel/signal.c | 1 |
3 files changed, 6 insertions, 26 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 0523eb305c17..58546ab8fe54 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -694,10 +694,8 @@ static void exit_notify(struct task_struct *tsk) * only has special meaning to our real parent. */ if (tsk->exit_signal != -1) { - if (tsk->parent == tsk->real_parent) - do_notify_parent(tsk, tsk->exit_signal); - else - do_notify_parent(tsk, SIGCHLD); + int signal = tsk->parent == tsk->real_parent ? tsk->exit_signal : SIGCHLD; + do_notify_parent(tsk, signal); } tsk->state = TASK_ZOMBIE; diff --git a/kernel/ptrace.c b/kernel/ptrace.c index f67675f3d9d3..287b81b65c34 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -252,49 +252,30 @@ int ptrace_writedata(struct task_struct *tsk, char * src, unsigned long dst, int static int ptrace_setoptions(struct task_struct *child, long data) { + child->ptrace &= ~PT_TRACE_MASK; + if (data & PTRACE_O_TRACESYSGOOD) child->ptrace |= PT_TRACESYSGOOD; - else - child->ptrace &= ~PT_TRACESYSGOOD; if (data & PTRACE_O_TRACEFORK) child->ptrace |= PT_TRACE_FORK; - else - child->ptrace &= ~PT_TRACE_FORK; if (data & PTRACE_O_TRACEVFORK) child->ptrace |= PT_TRACE_VFORK; - else - child->ptrace &= ~PT_TRACE_VFORK; if (data & PTRACE_O_TRACECLONE) child->ptrace |= PT_TRACE_CLONE; - else - child->ptrace &= ~PT_TRACE_CLONE; if (data & PTRACE_O_TRACEEXEC) child->ptrace |= PT_TRACE_EXEC; - else - child->ptrace &= ~PT_TRACE_EXEC; if (data & PTRACE_O_TRACEVFORKDONE) child->ptrace |= PT_TRACE_VFORK_DONE; - else - child->ptrace &= ~PT_TRACE_VFORK_DONE; if (data & PTRACE_O_TRACEEXIT) child->ptrace |= PT_TRACE_EXIT; - else - child->ptrace &= ~PT_TRACE_EXIT; - - if ((data & (PTRACE_O_TRACESYSGOOD | PTRACE_O_TRACEFORK - | PTRACE_O_TRACEVFORK | PTRACE_O_TRACECLONE - | PTRACE_O_TRACEEXEC | PTRACE_O_TRACEEXIT - | PTRACE_O_TRACEVFORKDONE)) - != data) - return -EINVAL; - return 0; + return (data & ~PTRACE_O_MASK) ? -EINVAL : 0; } static int ptrace_getsiginfo(struct task_struct *child, long data) diff --git a/kernel/signal.c b/kernel/signal.c index d0d09cfbe863..b8fc6a05c031 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -19,6 +19,7 @@ #include <linux/tty.h> #include <linux/binfmts.h> #include <linux/security.h> +#include <linux/ptrace.h> #include <asm/param.h> #include <asm/uaccess.h> #include <asm/siginfo.h> |
