]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
src/useradd.c: close_group_files(): Cosmetic
authorAlejandro Colomar <alx@kernel.org>
Wed, 7 Jun 2023 21:56:26 +0000 (23:56 +0200)
committerSerge Hallyn <serge@hallyn.com>
Sat, 10 Jun 2023 00:02:41 +0000 (19:02 -0500)
-  Invert conditional, to reduce indentation.
-  Reduce use of whitespace and newlines while unindenting.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
src/useradd.c

index 21bf2adea34d7a22c02d6c45646608f4d02386d8..c58e509f7c1bd6a2b35cd6f851cffe491886c780 100644 (file)
@@ -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 */
 }
 
 /*