gnu: webkitgtk: Update to 2.28.2.
[jackhill/guix/guix.git] / gnu / build / accounts.scm
index 8687446..f60d68d 100644 (file)
@@ -238,7 +238,7 @@ to it atomically and set the appropriate permissions."
       (for-each (lambda (entry)
                   (display (entry->string entry) port)
                   (newline port))
-                entries))
+                (delete-duplicates entries)))
 
     (if (port? file-or-port)
         (write-entries file-or-port)
@@ -249,9 +249,13 @@ to it atomically and set the appropriate permissions."
             (lambda ()
               (chmod port mode)
               (write-entries port)
+
+              (fsync port)
+              (close-port port)
               (rename-file template file-or-port))
             (lambda ()
-              (close-port port)
+              (unless (port-closed? port)
+                (close-port port))
               (when (file-exists? template)
                 (delete-file template))))))))