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:
parent
61b7e96877
commit
7866294e32
1 changed files with 4 additions and 1 deletions
|
@ -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)))
|
||||||
|
|
Loading…
Reference in a new issue