lib/limits.c: set_umask(): Simplify, by calling str2i(mode_t, ) instead of str2ul()

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:02:38 +01:00
parent dba5600cef
commit 169cbe1f56

View 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;