Re: [PATCH] use defines in sys_getpriority/sys_setpriority

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 10 May 2007 10:22:23 -0700
Daniel Walker <[email protected]> wrote:

> Switch to the defines for these two checks, instead of hard
> coding the values.
> 
> Signed-Off-By: Daniel Walker <[email protected]>
> 
> ---
>  kernel/sys.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Index: linux-2.6.21/kernel/sys.c
> ===================================================================
> --- linux-2.6.21.orig/kernel/sys.c
> +++ linux-2.6.21/kernel/sys.c
> @@ -598,7 +598,7 @@ asmlinkage long sys_setpriority(int whic
>  	int error = -EINVAL;
>  	struct pid *pgrp;
>  
> -	if (which > 2 || which < 0)
> +	if (which > PRIO_USER || which < PRIO_PROCESS)
>  		goto out;
>  
>  	/* normalize: avoid signed division (rounding problems) */
> @@ -662,7 +662,7 @@ asmlinkage long sys_getpriority(int whic
>  	long niceval, retval = -ESRCH;
>  	struct pid *pgrp;
>  
> -	if (which > 2 || which < 0)
> +	if (which > PRIO_USER || which < PRIO_PROCESS)
>  		return -EINVAL;
>  
>  	read_lock(&tasklist_lock);

I added this:

--- a/kernel/sys.c~use-defines-in-sys_getpriority-sys_setpriority-fix
+++ a/kernel/sys.c
@@ -14,6 +14,7 @@
 #include <linux/prctl.h>
 #include <linux/highuid.h>
 #include <linux/fs.h>
+#include <linux/resource.h>
 #include <linux/kernel.h>
 #include <linux/kexec.h>
 #include <linux/workqueue.h>
_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux