From ed8570dce3683b73bdf668b3ad0f529a1cea30c5 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 5 Jun 2019 11:12:21 +0200 Subject: 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(-) (limited to 'gnu/build') 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 @@ (define (write-entries port) (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)))))))) -- cgit v1.2.3