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
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

@ -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))))))))