aboutsummaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-08-22 17:14:20 +0200
committerLudovic Courtès <ludo@gnu.org>2013-08-22 17:14:20 +0200
commitb6952cad8dadd40f0fa44d4997583991acf8cb3f (patch)
treebaa3d405256b2fb8503643afa3c5503c33733489 /guix
parent3f69e393d33434a052fefcfa1875d841eb09797d (diff)
downloadgnu-guix-b6952cad8dadd40f0fa44d4997583991acf8cb3f.tar
gnu-guix-b6952cad8dadd40f0fa44d4997583991acf8cb3f.tar.gz
substitute-binary: Try hard to avoid port buffering.
* guix/scripts/substitute-binary.scm (fetch): In the `file' case, open with the `b' flag, so that the coding cookie reading thing doesn't lead to buffering some of the data (on 2.0.5). * tests/utils.scm ("filtered-port, file"): Open with `r0b'. Fixes a test failure with Guile 2.0.5 whereby the first byte of FILE would be missing from DECOMPRESSED.
Diffstat (limited to 'guix')
-rwxr-xr-xguix/scripts/substitute-binary.scm5
1 files changed, 2 insertions, 3 deletions
diff --git a/guix/scripts/substitute-binary.scm b/guix/scripts/substitute-binary.scm
index 0fdec456f6..4a013fe277 100755
--- a/guix/scripts/substitute-binary.scm
+++ b/guix/scripts/substitute-binary.scm
@@ -143,9 +143,8 @@ again."
provide."
(case (uri-scheme uri)
((file)
- (let ((port (open-input-file (uri-path uri))))
- (unless buffered?
- (setvbuf port _IONBF))
+ (let ((port (open-file (uri-path uri)
+ (if buffered? "rb" "r0b"))))
(values port (stat:size (stat port)))))
((http)
;; On Guile 2.0.5, `http-fetch' fetches the whole thing at once. So