From 7866294e32f1e758d06fce4e1b1035eca3a7d772 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 10 Dec 2022 18:12:59 +0100 Subject: deduplicate: Use 'sendfile' only with file ports. Fixes a regression introduced in b129026e2e242e9068158ae6e6fcd8d7c5ea092e. * guix/store/deduplication.scm (dump-file/deduplicate): Use 'sendfile' only when INPUT' is a file port. --- guix/store/deduplication.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/store/deduplication.scm b/guix/store/deduplication.scm index 9953675319..acb6ffcc4a 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))) -- cgit v1.2.3