]> git.cameronkatri.com Git - pw-darwin.git/blobdiff - pw/pwupd.c
Remove an uneeded indentation introduced in r286196 to silence gcc warnging
[pw-darwin.git] / pw / pwupd.c
index ee23952e090f6f8f1d962e305fe39ad70522ce21..ac91c9e4c1bb38ea63bc81b610fca1f7024b4147 100644 (file)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (C) 1996
  *     David L. Nugent.  All rights reserved.
  *
@@ -111,8 +113,11 @@ pw_update(struct passwd * pwd, char const * user)
        }
        if (pw_copy(pfd, tfd, pw, old_pw) == -1) {
                pw_fini();
+               close(tfd);
                err(1, "pw_copy()");
        }
+       fsync(tfd);
+       close(tfd);
        /*
         * in case of deletion of a user, the whole database
         * needs to be regenerated