From e72f50a7873b3233a8f962a7374e1219d0426230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 25 Feb 2016 16:49:11 +0100 Subject: [PATCH] http-client: 'http-fetch/cached' updates the cache atomically. * guix/http-client.scm (http-fetch/cached)[update-cache]: Use 'with-atomic-file-output' instead of 'call-with-output-file'. --- guix/http-client.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guix/http-client.scm b/guix/http-client.scm index 31b511eb1c..b26795c64d 100644 --- a/guix/http-client.scm +++ b/guix/http-client.scm @@ -291,7 +291,7 @@ Raise an '&http-get-error' condition if downloading fails." ;; Update the cache and return an input port. (let ((port (http-fetch uri #:text? text?))) (mkdir-p directory) - (call-with-output-file file + (with-atomic-file-output file (cut dump-port port <>)) (close-port port) (open-input-file file)))