lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <899055f9b6fc82c7c6b824029f49be9ff00d160b.1394532288.git.yangds.fnst@cn.fujitsu.com>
Date:	Tue, 11 Mar 2014 18:09:11 +0800
From:	Dongsheng Yang <yangds.fnst@...fujitsu.com>
To:	linux-kernel@...r.kernel.org
Cc:	peterz@...radead.org, joe@...ches.com, mingo@...nel.org,
	tglx@...utronix.de, heiko.carstens@...ibm.com,
	Dongsheng Yang <yangds.fnst@...fujitsu.com>
Subject: [PATCH 03/17] kernel/sys: Replace opened code implementation with nice_to_rlimit().

Signed-off-by: Dongsheng Yang <yangds.fnst@...fujitsu.com>
---
 kernel/sys.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/sys.c b/kernel/sys.c
index 61a2ae9..1bfe79a 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -250,7 +250,7 @@ SYSCALL_DEFINE2(getpriority, int, which, int, who)
 		else
 			p = current;
 		if (p) {
-			niceval = 20 - task_nice(p);
+			niceval = nice_to_rlimit(task_nice(p));
 			if (niceval > retval)
 				retval = niceval;
 		}
@@ -261,7 +261,7 @@ SYSCALL_DEFINE2(getpriority, int, which, int, who)
 		else
 			pgrp = task_pgrp(current);
 		do_each_pid_thread(pgrp, PIDTYPE_PGID, p) {
-			niceval = 20 - task_nice(p);
+			niceval = nice_to_rlimit(task_nice(p));
 			if (niceval > retval)
 				retval = niceval;
 		} while_each_pid_thread(pgrp, PIDTYPE_PGID, p);
@@ -277,7 +277,7 @@ SYSCALL_DEFINE2(getpriority, int, which, int, who)
 
 		do_each_thread(g, p) {
 			if (uid_eq(task_uid(p), uid)) {
-				niceval = 20 - task_nice(p);
+				niceval = nice_to_rlimit(task_nice(p));
 				if (niceval > retval)
 					retval = niceval;
 			}
-- 
1.8.2.1

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ