summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xguix/scripts/substitute-binary.scm5
-rw-r--r--tests/utils.scm2
2 files changed, 3 insertions, 4 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
diff --git a/tests/utils.scm b/tests/utils.scm
index e8549204d0..3be60e443d 100644
--- a/tests/utils.scm
+++ b/tests/utils.scm
@@ -103,7 +103,7 @@
 
 (test-assert "filtered-port, file"
   (let* ((file  (search-path %load-path "guix.scm"))
-         (input (open-file file "r0")))
+         (input (open-file file "r0b")))
     (let*-values (((compressed pids1)
                    (filtered-port `(,%gzip "-c" "--fast") input))
                   ((decompressed pids2)