deduplicate: Use 'sendfile' only with file ports.
Changes
1 files changed · +4 −1
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| guix/store/deduplication.scm | modified | +4 | −1 | View file |
guix/store/deduplication.scm
View filediff --git a/guix/store/deduplication.scm b/guix/store/deduplication.scm
index 9953675..acb6ffc 100644
--- a/guix/store/deduplication.scm
+++ b/guix/store/deduplication.scm
@@ -262,7 +262,10 @@ down the road."
(deduplicate file (dump-and-compute-hash) #:store store)
(call-with-output-file file
(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
#:key (store (%store-directory)))