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'.
This commit is contained in:
Ludovic Courtès 2016-02-25 16:49:11 +01:00
parent 736f9ffce2
commit e72f50a787

View file

@ -291,7 +291,7 @@ (define (update-cache)
;; 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)))