public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Daniel Walker <dwalker@mvista.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] use defines in sys_getpriority/sys_setpriority
Date: Thu, 10 May 2007 16:48:19 -0700	[thread overview]
Message-ID: <20070510164819.9248c4ab.akpm@linux-foundation.org> (raw)
In-Reply-To: <20070510172223.898755987@mvista.com>

On Thu, 10 May 2007 10:22:23 -0700
Daniel Walker <dwalker@mvista.com> wrote:

> Switch to the defines for these two checks, instead of hard
> coding the values.
> 
> Signed-Off-By: Daniel Walker <dwalker@mvista.com>
> 
> ---
>  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>
_


      reply	other threads:[~2007-05-10 23:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-10 17:22 [PATCH] use defines in sys_getpriority/sys_setpriority Daniel Walker
2007-05-10 23:48 ` Andrew Morton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070510164819.9248c4ab.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=dwalker@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox