aboutsummaryrefslogtreecommitdiff
path: root/guix/zlib.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-07-27 11:44:34 +0200
committerLudovic Courtès <ludo@gnu.org>2016-07-27 12:45:01 +0200
commitd00240c36e7bcf73f63e9e21c6ecec6f86d354ab (patch)
tree72ae3809692a65691dd5bfe23ecc2f5d728e70a7 /guix/zlib.scm
parent46bd451520d7a318e8b52a4a500d146403b8dcb8 (diff)
downloadgnu-guix-d00240c36e7bcf73f63e9e21c6ecec6f86d354ab.tar
gnu-guix-d00240c36e7bcf73f63e9e21c6ecec6f86d354ab.tar.gz
zlib: Clarify when 'gzread!' can return zero.
* guix/zlib.scm (gzread!): Augment docstring to clarify when zero is returned (based on reading zlib code). (make-gzip-input-port)[read!]: Remove scary comment.
Diffstat (limited to 'guix/zlib.scm')
-rw-r--r--guix/zlib.scm4
1 files changed, 2 insertions, 2 deletions
diff --git a/guix/zlib.scm b/guix/zlib.scm
index 51e5e9e426..40f5294ceb 100644
--- a/guix/zlib.scm
+++ b/guix/zlib.scm
@@ -92,7 +92,8 @@ closes FD."
(let ((proc (zlib-procedure int "gzread" (list '* '* unsigned-int))))
(lambda* (gzfile bv #:optional (start 0) (count (bytevector-length bv)))
"Read up to COUNT bytes from GZFILE into BV at offset START. Return the
-number of uncompressed bytes actually read."
+number of uncompressed bytes actually read; it is zero if COUNT is zero or if
+the end-of-stream has been reached."
(let ((ret (proc (gzip-file->pointer gzfile)
(bytevector->pointer bv start)
count)))
@@ -172,7 +173,6 @@ buffer increases decompression speed."
(gzdopen (fileno port) "r"))
(define (read! bv start count)
- ;; XXX: Can 'gzread!' return zero even though we haven't reached the EOF?
(gzread! gzfile bv start count))
(unless (= buffer-size %default-buffer-size)