1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-25 10:31:49 +02:00

accounts: Close database before renaming it.

Fixes <https://bugs.gnu.org/35996>.
Reported by Florian Pelz <pelzflorian@pelzflorian.de>.

* gnu/build/accounts.scm (database-writer): Move 'close-port' call
before 'rename-file'.
This commit is contained in:
Ludovic Courtès
2019-06-05 11:12:21 +02:00
parent 70a7a1b5dc
commit ed8570dce3
+3 -1
View File
@@ -249,9 +249,11 @@ to it atomically and set the appropriate permissions."
(lambda ()
(chmod port mode)
(write-entries 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))))))))