From: Alejandro Colomar Date: Wed, 7 Jun 2023 21:56:26 +0000 (+0200) Subject: src/useradd.c: close_group_files(): Cosmetic X-Git-Tag: 4.14.0-rc1~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7415885fb37505f8c543814e7508ab4dd7f234d3;p=thirdparty%2Fshadow.git 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 --- diff --git a/src/useradd.c b/src/useradd.c index 21bf2adea..c58e509f7 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); - } + 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 */ + 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 */ } /*