From 6b140ec5c719175393101d5f723371303e09426e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Fri, 12 Jun 2015 09:56:39 +0300 Subject: fix bstream_from_fd to use mmap when available --- src/io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/io.c') diff --git a/src/io.c b/src/io.c index 136153cb14..a62ef36b46 100644 --- a/src/io.c +++ b/src/io.c @@ -365,7 +365,8 @@ struct apk_bstream *apk_bstream_from_fd_pid(int fd, pid_t pid, int (*translate_s if (pid == 0) { bs = apk_mmap_bstream_from_fd(fd); - if (IS_ERR_OR_NULL(bs)) return ERR_CAST(bs); + if (!IS_ERR_OR_NULL(bs)) + return bs; } return apk_bstream_from_istream(apk_istream_from_fd_pid(fd, pid, translate_status)); -- cgit v1.2.3