guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch version-1.4.0 updated: deduplicate: Use 'sendfile' only with file


From: guix-commits
Subject: branch version-1.4.0 updated: deduplicate: Use 'sendfile' only with file ports.
Date: Sat, 10 Dec 2022 12:18:25 -0500

This is an automated email from the git hooks/post-receive script.

civodul pushed a commit to branch version-1.4.0
in repository guix.

The following commit(s) were added to refs/heads/version-1.4.0 by this push:
     new 7866294e32 deduplicate: Use 'sendfile' only with file ports.
7866294e32 is described below

commit 7866294e32f1e758d06fce4e1b1035eca3a7d772
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Dec 10 18:12:59 2022 +0100

    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(-)

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)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]