diff options
author | Ludovic Courtès <ludo@gnu.org> | 2019-06-05 11:12:21 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2019-06-05 23:10:37 +0200 |
commit | ed8570dce3683b73bdf668b3ad0f529a1cea30c5 (patch) | |
tree | b99579be74e885712c43938448bb25bd4bb8a322 /gnu/build/accounts.scm | |
parent | 70a7a1b5dc529de34304dea5aa4d2b58e7a5d305 (diff) | |
download | patches-ed8570dce3683b73bdf668b3ad0f529a1cea30c5.tar patches-ed8570dce3683b73bdf668b3ad0f529a1cea30c5.tar.gz |
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'.
Diffstat (limited to 'gnu/build/accounts.scm')
-rw-r--r-- | gnu/build/accounts.scm | 4 |
1 files changed, 3 insertions, 1 deletions
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)))))))) |