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:
Alejandro Colomar
2024-01-09 20:01:57 +01:00
parent 5f2055c395
commit dba5600cef

View File

@@ -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;
}