]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/limits.c: set_prio(): Simplify, by calling str2si() instead of str2sl()
authorAlejandro Colomar <alx@kernel.org>
Tue, 9 Jan 2024 19:01:57 +0000 (20:01 +0100)
committerAlejandro Colomar <alx@kernel.org>
Tue, 2 Jul 2024 20:52:31 +0000 (22:52 +0200)
Reviewed-by: "Serge E. Hallyn" <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/limits.c

index 265235bac3ced76d41aefee88601bd57e5827043..e75693de92e07a8d42cc2d79fcc6375158d90190 100644 (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;
        }