3
5
Fork 0
mirror of git://git.savannah.gnu.org/guix.git synced 2023-12-14 03:33:07 +01:00

deduplicate: Use 'sendfile' only with file ports.

Fixes a regression introduced in b129026e2e.

* guix/store/deduplication.scm (dump-file/deduplicate): Use 'sendfile'
only when INPUT' is a file port.
This commit is contained in:
Ludovic Courtès 2022-12-10 18:12:59 +01:00
parent 61b7e96877
commit 7866294e32
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -262,7 +262,10 @@ down the road."
(deduplicate file (dump-and-compute-hash) #:store store) (deduplicate file (dump-and-compute-hash) #:store store)
(call-with-output-file file (call-with-output-file file
(lambda (output) (lambda (output)
(sendfile output input size 0))))) (if (file-port? input)
(sendfile output input size 0)
(dump-port input output size
#:buffer-size %deduplication-minimum-size))))))
(define* (copy-file/deduplicate source target (define* (copy-file/deduplicate source target
#:key (store (%store-directory))) #:key (store (%store-directory)))