mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 00:21:17 +00:00
[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>
This commit is contained in:
parent
e5bdd883a1
commit
7ed20e1ad5
33 changed files with 90 additions and 59 deletions
|
@ -27,6 +27,7 @@
|
|||
#include <linux/mempolicy.h>
|
||||
#include <linux/cpuset.h>
|
||||
#include <linux/syscalls.h>
|
||||
#include <linux/signal.h>
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/unistd.h>
|
||||
|
@ -277,7 +278,7 @@ void set_special_pids(pid_t session, pid_t pgrp)
|
|||
*/
|
||||
int allow_signal(int sig)
|
||||
{
|
||||
if (sig < 1 || sig > _NSIG)
|
||||
if (!valid_signal(sig) || sig < 1)
|
||||
return -EINVAL;
|
||||
|
||||
spin_lock_irq(¤t->sighand->siglock);
|
||||
|
@ -298,7 +299,7 @@ EXPORT_SYMBOL(allow_signal);
|
|||
|
||||
int disallow_signal(int sig)
|
||||
{
|
||||
if (sig < 1 || sig > _NSIG)
|
||||
if (!valid_signal(sig) || sig < 1)
|
||||
return -EINVAL;
|
||||
|
||||
spin_lock_irq(¤t->sighand->siglock);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue