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 /drivers/char | |
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 'drivers/char')
-rw-r--r-- | drivers/char/vt_ioctl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c index 5d386f4bea49..8971484b956b 100644 --- a/drivers/char/vt_ioctl.c +++ b/drivers/char/vt_ioctl.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/major.h> | 24 | #include <linux/major.h> |
25 | #include <linux/fs.h> | 25 | #include <linux/fs.h> |
26 | #include <linux/console.h> | 26 | #include <linux/console.h> |
27 | #include <linux/signal.h> | ||
27 | 28 | ||
28 | #include <asm/io.h> | 29 | #include <asm/io.h> |
29 | #include <asm/uaccess.h> | 30 | #include <asm/uaccess.h> |
@@ -641,7 +642,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
641 | extern int spawnpid, spawnsig; | 642 | extern int spawnpid, spawnsig; |
642 | if (!perm || !capable(CAP_KILL)) | 643 | if (!perm || !capable(CAP_KILL)) |
643 | return -EPERM; | 644 | return -EPERM; |
644 | if (arg < 1 || arg > _NSIG || arg == SIGKILL) | 645 | if (!valid_signal(arg) || arg < 1 || arg == SIGKILL) |
645 | return -EINVAL; | 646 | return -EINVAL; |
646 | spawnpid = current->pid; | 647 | spawnpid = current->pid; |
647 | spawnsig = arg; | 648 | spawnsig = arg; |