From 9c39b1319442d10d1630f94d11e13b4687e62fc9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20G=C3=B6ttsche?= Date: Mon, 11 Dec 2023 18:12:24 +0100 Subject: [PATCH] src/chfn,chpasswd,newusers: declare fatal_exit() NORETURN Help static analyzers to understand fatal_exit() does never return. --- src/chfn.c | 2 +- src/chpasswd.c | 2 +- src/newusers.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chfn.c b/src/chfn.c index 417ac35f1..4c68bf235 100644 --- a/src/chfn.c +++ b/src/chfn.c @@ -57,7 +57,7 @@ static bool pw_locked = false; */ /* local function prototypes */ -static void fail_exit (int code); +NORETURN static void fail_exit (int code); NORETURN static void usage (int status); static bool may_change_field (int); static void new_fields (void); diff --git a/src/chpasswd.c b/src/chpasswd.c index 1a1a5d599..8bc920e44 100644 --- a/src/chpasswd.c +++ b/src/chpasswd.c @@ -61,7 +61,7 @@ static bool pw_locked = false; static bool spw_locked = false; /* local function prototypes */ -static void fail_exit (int code); +NORETURN static void fail_exit (int code); NORETURN static void usage (int status); static void process_flags (int argc, char **argv); static void check_flags (void); diff --git a/src/newusers.c b/src/newusers.c index 08f797985..81eab640e 100644 --- a/src/newusers.c +++ b/src/newusers.c @@ -90,8 +90,8 @@ static bool sub_gid_locked = false; #endif /* ENABLE_SUBIDS */ /* local function prototypes */ -static void usage (int status); -static void fail_exit (int); +NORETURN static void usage (int status); +NORETURN static void fail_exit (int); static int add_group (const char *, const char *, gid_t *, gid_t); static int get_user_id (const char *, uid_t *); static int add_user (const char *, uid_t, gid_t); -- 2.47.2