diff options
author | Caleb Ristvedt <caleb.ristvedt@cune.org> | 2020-05-06 11:52:16 -0500 |
---|---|---|
committer | Caleb Ristvedt <caleb.ristvedt@cune.org> | 2020-05-07 05:56:01 -0500 |
commit | b338c41c824c57d9de506404717ea7b3d2887f45 (patch) | |
tree | cd139d88f958904cfc09f4c2c0ccc48c6942ce79 /guix/nar.scm | |
parent | 37edbc91e34fb5658261e637e6ffccdb381e5271 (diff) | |
download | guix-b338c41c824c57d9de506404717ea7b3d2887f45.tar.gz guix-b338c41c824c57d9de506404717ea7b3d2887f45.zip |
nar: 'with-temporary-store-file' uses a single connection
Previously the 'with-store' form was entered every time a different temporary
file was tried. This caused there to be as many simultaneous open connections
as there were attempts, and prevented the (loop ...) call from being a tail
call. This change fixes that.
* guix/nar.scm (with-temporary-store-file): open connection once prior to
entering the loop.
Diffstat (limited to 'guix/nar.scm')
-rw-r--r-- | guix/nar.scm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/guix/nar.scm b/guix/nar.scm index 0a6f59b09a..eff4becbce 100644 --- a/guix/nar.scm +++ b/guix/nar.scm @@ -138,8 +138,8 @@ held." (define-syntax-rule (with-temporary-store-file name body ...) "Evaluate BODY with NAME bound to the file name of a temporary store item protected from GC." - (let loop ((name (temporary-store-file))) - (with-store store + (with-store store + (let loop ((name (temporary-store-file))) ;; Add NAME to the current process' roots. (Opening this connection to ;; the daemon allows us to reuse its code that deals with the ;; per-process roots file.) |