From 7415885fb37505f8c543814e7508ab4dd7f234d3 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 7 Jun 2023 23:56:26 +0200 Subject: [PATCH] src/useradd.c: close_group_files(): Cosmetic - Invert conditional, to reduce indentation. - Reduce use of whitespace and newlines while unindenting. Signed-off-by: Alejandro Colomar --- src/useradd.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/useradd.c b/src/useradd.c index 21bf2ade..c58e509f 100644 --- a/src/useradd.c +++ b/src/useradd.c @@ -1762,23 +1762,25 @@ static void close_files (void) */ static void close_group_files (void) { - if (do_grp_update) { - if (gr_close () == 0) { - fprintf (stderr, - _("%s: failure while writing changes to %s\n"), Prog, gr_dbname ()); - SYSLOG ((LOG_ERR, "failure while writing changes to %s", gr_dbname ())); - fail_exit (E_GRP_UPDATE); - } -#ifdef SHADOWGRP - if (is_shadow_grp && (sgr_close () == 0)) { - fprintf (stderr, - _("%s: failure while writing changes to %s\n"), - Prog, sgr_dbname ()); - SYSLOG ((LOG_ERR, "failure while writing changes to %s", sgr_dbname ())); - fail_exit (E_GRP_UPDATE); - } -#endif /* SHADOWGRP */ + if (!do_grp_update) + return; + + if (gr_close() == 0) { + fprintf(stderr, + _("%s: failure while writing changes to %s\n"), + Prog, gr_dbname()); + SYSLOG((LOG_ERR, "failure while writing changes to %s", gr_dbname())); + fail_exit(E_GRP_UPDATE); } +#ifdef SHADOWGRP + if (is_shadow_grp && sgr_close() == 0) { + fprintf(stderr, + _("%s: failure while writing changes to %s\n"), + Prog, sgr_dbname()); + SYSLOG((LOG_ERR, "failure while writing changes to %s", sgr_dbname())); + fail_exit(E_GRP_UPDATE); + } +#endif /* SHADOWGRP */ } /*