Commit 30580398 authored by Natanael Copa's avatar Natanael Copa
Browse files

main/apk-tools: fix apk fetch --stdout

parent bad83d46
From 19356dfbd6b3e7d4880d29b1f4b5c0cb665eb467 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Fri, 11 Sep 2015 16:16:26 +0200
Subject: [PATCH] io: fix posix_fallocate failure handling
We need fall back to a splice buffer if posix_fallocate call fails due
to file being a device (eg tty) or a pipe. This fixes apk fetch --stdout.
---
src/io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/io.c b/src/io.c
index a321c0c..65851be 100644
--- a/src/io.c
+++ b/src/io.c
@@ -149,7 +149,7 @@ size_t apk_istream_splice(void *stream, int fd, size_t size,
if (r == 0)
mmapbase = mmap(NULL, size, PROT_READ | PROT_WRITE,
MAP_SHARED, fd, 0);
- else if (r != ENOSYS)
+ else if (r == EBADF || r == EFBIG || r == ENOSPC || r == EIO)
return -r;
}
if (bufsz > 2*1024*1024)
--
2.5.1
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=apk-tools
pkgver=2.6.4
pkgrel=0
pkgrel=1
pkgdesc="Alpine Package Keeper - package manager for alpine"
subpackages="$pkgname-static"
depends=
......@@ -13,6 +13,7 @@ if [ "$CBUILD" = "$CHOST" ]; then
makedepends="$makedepends lua5.2-dev"
fi
source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.xz
0001-io-fix-posix_fallocate-failure-handling.patch
"
url="http://git.alpinelinux.org/cgit/apk-tools/"
......@@ -82,6 +83,9 @@ luaapk() {
mv "$pkgdir"/usr/lib "$subpkgdir"/usr/lib/
}
md5sums="14585ea5607a755beb57512261afd318 apk-tools-2.6.4.tar.xz"
sha256sums="0c0f7e87d8241953ba06ab84d1dc82ad119bfb17b365c6a44cdd51bac3ab429c apk-tools-2.6.4.tar.xz"
sha512sums="cf7327d283af8c1ac00632cccc8f607cad8cf4a5118c07b2d258214c55d64126c8c336b7c3619c4fd7e5bb06841c33c92b4a298e51c86459eef6919663de3cf4 apk-tools-2.6.4.tar.xz"
md5sums="14585ea5607a755beb57512261afd318 apk-tools-2.6.4.tar.xz
0616bb34e33a101637669d14086077ca 0001-io-fix-posix_fallocate-failure-handling.patch"
sha256sums="0c0f7e87d8241953ba06ab84d1dc82ad119bfb17b365c6a44cdd51bac3ab429c apk-tools-2.6.4.tar.xz
863e9af2d8f14c63e06c76d11dfaf3e4fa941d22d471b35c5901dafef21721e5 0001-io-fix-posix_fallocate-failure-handling.patch"
sha512sums="cf7327d283af8c1ac00632cccc8f607cad8cf4a5118c07b2d258214c55d64126c8c336b7c3619c4fd7e5bb06841c33c92b4a298e51c86459eef6919663de3cf4 apk-tools-2.6.4.tar.xz
9aaf5f3f83ed4012a49ff458cdc040318a734992d2754eac034f2bbeaccc5c2f9797240675346581248b1ce0bdf3b2a8c59deb19bf770eb4d6537864e6c6ced1 0001-io-fix-posix_fallocate-failure-handling.patch"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment