From 169cbe1f56a6782d5cd1667b37fb84ee3313fe42 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Tue, 9 Jan 2024 20:02:38 +0100 Subject: [PATCH] lib/limits.c: set_umask(): Simplify, by calling str2i(mode_t, ) instead of str2ul() Reviewed-by: "Serge E. Hallyn" Signed-off-by: Alejandro Colomar --- lib/limits.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/limits.c b/lib/limits.c index e75693de9..e86ac238a 100644 --- a/lib/limits.c +++ b/lib/limits.c @@ -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; -- 2.47.3