lib/limits.c: set_prio(): Simplify, by calling str2si() instead of str2sl()
Reviewed-by: "Serge E. Hallyn" <serge@hallyn.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
10
lib/limits.c
10
lib/limits.c
@@ -84,14 +84,14 @@ static int setrlimit_value (unsigned int resource,
|
||||
}
|
||||
|
||||
|
||||
static int set_prio (const char *value)
|
||||
static int
|
||||
set_prio(const char *value)
|
||||
{
|
||||
long prio;
|
||||
int prio;
|
||||
|
||||
if ( (str2sl(&prio, value) == -1)
|
||||
|| (prio != (int) prio)) {
|
||||
if (str2si(&prio, value) == -1)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (setpriority (PRIO_PROCESS, 0, prio) != 0) {
|
||||
return LOGIN_ERROR_RLIMIT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user