]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/limits.c: set_umask(): Simplify, by calling str2i(mode_t, ) instead of str2ul()
authorAlejandro Colomar <alx@kernel.org>
Tue, 9 Jan 2024 19:02:38 +0000 (20:02 +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 e75693de92e07a8d42cc2d79fcc6375158d90190..e86ac238ae5eddccd7b80705d188282b7ccb89e2 100644 (file)
@@ -99,14 +99,13 @@ set_prio(const char *value)
 }
 
 
-static int set_umask (const char *value)
+static int
+set_umask(const char *value)
 {
-       unsigned long  mask;
+       mode_t  mask;
 
-       if (   (str2ul(&mask, value) == -1)
-           || (mask != (mode_t) mask)) {
+       if (str2i(mode_t, &mask, value) == -1)
                return 0;
-       }
 
        (void) umask (mask);
        return 0;