From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 62E9F139085 for ; Tue, 27 Dec 2016 23:05:01 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B134D21C038; Tue, 27 Dec 2016 23:04:59 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7F91121C038 for ; Tue, 27 Dec 2016 23:04:59 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 38C81341134 for ; Tue, 27 Dec 2016 23:04:58 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8053324C5 for ; Tue, 27 Dec 2016 23:04:56 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1482879876.31c16e6d30301f4f5076e9f598a2271b82136621.vapier@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/grep/files/, sys-apps/grep/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-apps/grep/files/grep-2.27-splice.patch sys-apps/grep/grep-2.27-r1.ebuild sys-apps/grep/grep-2.27.ebuild X-VCS-Directories: sys-apps/grep/ sys-apps/grep/files/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 31c16e6d30301f4f5076e9f598a2271b82136621 X-VCS-Branch: master Date: Tue, 27 Dec 2016 23:04:56 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: caff204e-12d3-4ae6-9efe-8cef89bfd60e X-Archives-Hash: 3a2dcfec7be1fb34c4e293d81ad0fc68 commit: 31c16e6d30301f4f5076e9f598a2271b82136621 Author: Mike Frysinger gentoo org> AuthorDate: Tue Dec 27 23:04:30 2016 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Tue Dec 27 23:04:36 2016 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31c16e6d sys-apps/grep: add upstream fix for splice errors sys-apps/grep/files/grep-2.27-splice.patch | 60 ++++++++++++++++++++++ .../grep/{grep-2.27.ebuild => grep-2.27-r1.ebuild} | 1 + 2 files changed, 61 insertions(+) diff --git a/sys-apps/grep/files/grep-2.27-splice.patch b/sys-apps/grep/files/grep-2.27-splice.patch new file mode 100644 index 00000000..6c36fe0 --- /dev/null +++ b/sys-apps/grep/files/grep-2.27-splice.patch @@ -0,0 +1,60 @@ +http://lists.gnu.org/archive/html/bug-grep/2016-12/msg00036.html + +From 7ad47abbcb070946000771a829b51224720b8cef Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Tue, 27 Dec 2016 11:16:32 -0800 +Subject: [PATCH] grep: fix bug with '... | grep pat >> /dev/null' +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Problem reported by Benno Fünfstück (Bug#25283). +* NEWS: Document this. +* src/grep.c (drain_input) [SPLICE_F_MOVE]: +Don't assume /dev/null is always acceptable output to splice. +* tests/grep-dev-null-out: Test for the bug. +--- + NEWS | 7 ++++--- + src/grep.c | 14 +++++++++----- + tests/grep-dev-null-out | 2 ++ + 3 files changed, 15 insertions(+), 8 deletions(-) + +diff --git a/src/grep.c b/src/grep.c +index f28f3c287609..aebab2060308 100644 +--- a/src/grep.c ++++ b/src/grep.c +@@ -1728,11 +1728,15 @@ drain_input (int fd, struct stat const *st) + { + #ifdef SPLICE_F_MOVE + /* Should be faster, since it need not copy data to user space. */ +- while ((nbytes = splice (fd, NULL, STDOUT_FILENO, NULL, +- INITIAL_BUFSIZE, SPLICE_F_MOVE))) +- if (nbytes < 0) +- return false; +- return true; ++ nbytes = splice (fd, NULL, STDOUT_FILENO, NULL, ++ INITIAL_BUFSIZE, SPLICE_F_MOVE); ++ if (0 <= nbytes || errno != EINVAL) ++ { ++ while (0 < nbytes) ++ nbytes = splice (fd, NULL, STDOUT_FILENO, NULL, ++ INITIAL_BUFSIZE, SPLICE_F_MOVE); ++ return nbytes == 0; ++ } + #endif + } + while ((nbytes = safe_read (fd, buffer, bufalloc))) +diff --git a/tests/grep-dev-null-out b/tests/grep-dev-null-out +index 13a4843957a6..c8128d5cc6a4 100755 +--- a/tests/grep-dev-null-out ++++ b/tests/grep-dev-null-out +@@ -8,4 +8,6 @@ require_timeout_ + ${AWK-awk} 'BEGIN {while (1) print "x"}' /dev/null || fail=1 + ++echo abc | grep b >>/dev/null || fail=1 ++ + Exit $fail +-- +2.11.0 + diff --git a/sys-apps/grep/grep-2.27.ebuild b/sys-apps/grep/grep-2.27-r1.ebuild similarity index 97% rename from sys-apps/grep/grep-2.27.ebuild rename to sys-apps/grep/grep-2.27-r1.ebuild index 845de1d..f294f20 100644 --- a/sys-apps/grep/grep-2.27.ebuild +++ b/sys-apps/grep/grep-2.27-r1.ebuild @@ -28,6 +28,7 @@ DEPEND="${RDEPEND} DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO ) src_prepare() { + epatch "${FILESDIR}"/${P}-splice.patch sed -i \ -e "s:@SHELL@:${EPREFIX}/bin/sh:g" \ src/egrep.sh || die #523898