diff options
author | Jesper Juhl <juhl-lkml@dif.dk> | 2005-05-01 11:59:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-01 11:59:14 -0400 |
commit | 7ed20e1ad521b5f5df61bf6559ae60738e393741 (patch) | |
tree | 90931724e45eaedb3445314e8b94e78253642395 /arch/i386/kernel/ptrace.c | |
parent | e5bdd883a189243541e7a132385580703b049102 (diff) |
[PATCH] convert that currently tests _NSIG directly to use valid_signal()
Convert most of the current code that uses _NSIG directly to instead use
valid_signal(). This avoids gcc -W warnings and off-by-one errors.
Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/ptrace.c')
-rw-r--r-- | arch/i386/kernel/ptrace.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/i386/kernel/ptrace.c b/arch/i386/kernel/ptrace.c index b2f17640ceff..e8c965ce86eb 100644 --- a/arch/i386/kernel/ptrace.c +++ b/arch/i386/kernel/ptrace.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/security.h> | 16 | #include <linux/security.h> |
17 | #include <linux/audit.h> | 17 | #include <linux/audit.h> |
18 | #include <linux/seccomp.h> | 18 | #include <linux/seccomp.h> |
19 | #include <linux/signal.h> | ||
19 | 20 | ||
20 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
21 | #include <asm/pgtable.h> | 22 | #include <asm/pgtable.h> |
@@ -511,7 +512,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) | |||
511 | case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ | 512 | case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ |
512 | case PTRACE_CONT: /* restart after signal. */ | 513 | case PTRACE_CONT: /* restart after signal. */ |
513 | ret = -EIO; | 514 | ret = -EIO; |
514 | if ((unsigned long) data > _NSIG) | 515 | if (!valid_signal(data)) |
515 | break; | 516 | break; |
516 | if (request == PTRACE_SYSCALL) { | 517 | if (request == PTRACE_SYSCALL) { |
517 | set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | 518 | set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); |
@@ -543,7 +544,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) | |||
543 | 544 | ||
544 | case PTRACE_SINGLESTEP: /* set the trap flag. */ | 545 | case PTRACE_SINGLESTEP: /* set the trap flag. */ |
545 | ret = -EIO; | 546 | ret = -EIO; |
546 | if ((unsigned long) data > _NSIG) | 547 | if (!valid_signal(data)) |
547 | break; | 548 | break; |
548 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | 549 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); |
549 | set_singlestep(child); | 550 | set_singlestep(child); |