[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>
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
index 5d386f4..8971484 100644
--- a/drivers/char/vt_ioctl.c
+++ b/drivers/char/vt_ioctl.c
@@ -24,6 +24,7 @@
#include <linux/major.h>
#include <linux/fs.h>
#include <linux/console.h>
+#include <linux/signal.h>
#include <asm/io.h>
#include <asm/uaccess.h>
@@ -641,7 +642,7 @@
extern int spawnpid, spawnsig;
if (!perm || !capable(CAP_KILL))
return -EPERM;
- if (arg < 1 || arg > _NSIG || arg == SIGKILL)
+ if (!valid_signal(arg) || arg < 1 || arg == SIGKILL)
return -EINVAL;
spawnpid = current->pid;
spawnsig = arg;