From ed8570dce3683b73bdf668b3ad0f529a1cea30c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 5 Jun 2019 11:12:21 +0200 Subject: [PATCH] accounts: Close database before renaming it. Fixes . Reported by Florian Pelz . * gnu/build/accounts.scm (database-writer): Move 'close-port' call before 'rename-file'. --- gnu/build/accounts.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gnu/build/accounts.scm b/gnu/build/accounts.scm index 8687446aa6..2120c1d11d 100644 --- a/gnu/build/accounts.scm +++ b/gnu/build/accounts.scm @@ -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))))))))