From c25637dfe8aaf2aa7550c9196fb7e18820552ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 13 Jun 2016 18:00:29 +0200 Subject: [PATCH] utils: 'with-atomic-file-output' closes the port upon exception. Previously it could have left the file descriptor open. * guix/utils.scm (with-atomic-file-output): Call 'close-port' in handler. --- guix/utils.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guix/utils.scm b/guix/utils.scm index 18d913c514..2d8bfd84b0 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -630,7 +630,8 @@ (define (with-atomic-file-output file proc) (rename-file template file) result)) (lambda (key . args) - (false-if-exception (delete-file template)))))) + (false-if-exception (delete-file template)) + (close-port out))))) (define (cache-directory) "Return the cache directory for Guix, by default ~/.cache/guix."