From dba5600cef8e06313257a7fdd0dbe68715a8d2fa Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Tue, 9 Jan 2024 20:01:57 +0100 Subject: [PATCH] lib/limits.c: set_prio(): Simplify, by calling str2si() instead of str2sl() Reviewed-by: "Serge E. Hallyn" Signed-off-by: Alejandro Colomar --- lib/limits.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/limits.c b/lib/limits.c index 265235bac..e75693de9 100644 --- a/lib/limits.c +++ b/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; } -- 2.47.3