[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
08/09: accounts: Close database before renaming it.
From: |
guix-commits |
Subject: |
08/09: accounts: Close database before renaming it. |
Date: |
Wed, 5 Jun 2019 17:11:22 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit ed8570dce3683b73bdf668b3ad0f529a1cea30c5
Author: Ludovic Courtès <address@hidden>
Date: Wed Jun 5 11:12:21 2019 +0200
accounts: Close database before renaming it.
Fixes <https://bugs.gnu.org/35996>.
Reported by Florian Pelz <address@hidden>.
* 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 8687446..2120c1d 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))))))))
- branch master updated (c0f6eeb -> d088d5c), guix-commits, 2019/06/05
- 04/09: syscalls: 'with-file-lock' expands to a call to 'call-with-file-lock'., guix-commits, 2019/06/05
- 02/09: gnu: minizip: Do not install crypt.h., guix-commits, 2019/06/05
- 08/09: accounts: Close database before renaming it.,
guix-commits <=
- 01/09: guix package: Do not list environment variables that need to be set., guix-commits, 2019/06/05
- 03/09: syscalls: Add 'with-file-lock' macro., guix-commits, 2019/06/05
- 09/09: accounts: Call 'fdatasync' when writing databases., guix-commits, 2019/06/05
- 07/09: nar: Really lock store files., guix-commits, 2019/06/05
- 05/09: syscalls: 'with-lock-file' catches ENOSYS., guix-commits, 2019/06/05
- 06/09: activation: Lock /etc/.pwd.lock before accessing databases., guix-commits, 2019/06/05