diff options
author | Ludovic Courtès <ludo@gnu.org> | 2020-08-28 15:05:17 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-08-28 23:27:53 +0200 |
commit | 3d9ea605c8dfb7fc43689e12975218b032b3175a (patch) | |
tree | 5bd465a5cfa605ff65125db071e62f80246d16dd /guix | |
parent | b6308409206af78356ea7d1b2c4613ca1ee4315c (diff) | |
download | guix-3d9ea605c8dfb7fc43689e12975218b032b3175a.tar guix-3d9ea605c8dfb7fc43689e12975218b032b3175a.tar.gz |
store: 'with-store' returns as many values as its body.
Fixes <https://bugs.gnu.org/42912>.
Reported by Ricardo Wurmus <rekado@elephly.net>.
* guix/store.scm (call-with-store)[thunk]: Wrap call to PROC in
'call-with-values'.
* tests/store.scm ("with-store, multiple values"): New test.
Diffstat (limited to 'guix')
-rw-r--r-- | guix/store.scm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/guix/store.scm b/guix/store.scm index 683e125b20..495dc1692c 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -628,9 +628,10 @@ connection. Use with care." (define (thunk) (parameterize ((current-store-protocol-version (store-connection-version store))) - (let ((result (proc store))) - (close-connection store) - result))) + (call-with-values (lambda () (proc store)) + (lambda results + (close-connection store) + (apply values results))))) (cond-expand (guile-3 |