diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2022-12-10 18:12:59 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2022-12-10 18:13:39 +0100 |
| commit | 7866294e32f1e758d06fce4e1b1035eca3a7d772 (patch) | |
| tree | 0794c02b6da66e8761b57e7edc9b6a970a426653 | |
| parent | 61b7e9687757aff013b99e4ab15669a950c8b222 (diff) | |
deduplicate: Use 'sendfile' only with file ports.v1.4.0rc2
Fixes a regression introduced in b129026e2e242e9068158ae6e6fcd8d7c5ea092e.
* guix/store/deduplication.scm (dump-file/deduplicate): Use 'sendfile'
only when INPUT' is a file port.
| -rw-r--r-- | guix/store/deduplication.scm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/guix/store/deduplication.scm b/guix/store/deduplication.scm index 9953675319a..acb6ffcc4a5 100644 --- a/guix/store/deduplication.scm +++ b/guix/store/deduplication.scm | |||
| @@ -262,7 +262,10 @@ down the road." | |||
| 262 | (deduplicate file (dump-and-compute-hash) #:store store) | 262 | (deduplicate file (dump-and-compute-hash) #:store store) |
| 263 | (call-with-output-file file | 263 | (call-with-output-file file |
| 264 | (lambda (output) | 264 | (lambda (output) |
| 265 | (sendfile output input size 0))))) | 265 | (if (file-port? input) |
| 266 | (sendfile output input size 0) | ||
| 267 | (dump-port input output size | ||
| 268 | #:buffer-size %deduplication-minimum-size)))))) | ||
| 266 | 269 | ||
| 267 | (define* (copy-file/deduplicate source target | 270 | (define* (copy-file/deduplicate source target |
| 268 | #:key (store (%store-directory))) | 271 | #:key (store (%store-directory))) |
