From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: ARC-Seal: i=1; a=rsa-sha256; t=1516886670; cv=none; d=google.com; s=arc-20160816; b=Zvnkf97jrGJETRKl/fp2BuhQbneZu/ha28hP7dTp1qKdAl3d7mg4Cdw7wQYT147UTe rrP+goP3dTZAwkgdXjz0kNdhuTgvueltopql38LcnGlO8ye3AuOPYpqKVnw2XZ5B8VzO oY2fXiPBeoYPDxQ7IJ8MkcJQLMBZRwiSgAFuX05gMu5APX8qkp2DmGRr+XpIrE++cPfu feWaOH+G3finoI1XWO4Rrii8XlAVsDSqE2r3iTardQU4Mrvj2jJMD3wNv82Te2q+vSUf VP7g03bn7O5/K+0gT2degY4/cUUE5ZNivgVTXIYB6vixAaqjufSb4+qKZVTY7MZE1pGp H6PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:arc-authentication-results; bh=OIceJ1hESfE8/CwJFaiJvmv0z3vPyW8mYq7UELgPf4o=; b=QNcH/AYlDzpN/LvDYjPQhjvIQljDtGqMVsDYiOPIakKUZRpqfkLJ5VtBHGktDn1pNf 7ZbBTDFXinGl/joxmFKsw3Wlsc9DsIsH5rswkVtKqiqKCQ5WJWWA1CFdQ9+NorqOl8gQ nn35yHbxwZVQzk9NHh5ZoAMofhimStlJ2jHIRfccniUkkXk4K1LCOMxbI8CG+D/8ssva ZIiHQZE9E13j/h9lI7YU3UOECD4COSXk9hX+pHpogjggHY7N9tdI9uq0A7DQASJS4A13 BYGETzAc89FRgwbESkTlBZ+D5pHFVMc/nDAym+m/1yBw46m62DamAXLcQ99vOQRvy2f4 vr2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of niveditas98@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=niveditas98@gmail.com Authentication-Results: mx.google.com; spf=pass (google.com: domain of niveditas98@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=niveditas98@gmail.com X-Google-Smtp-Source: AH8x2249ZaYyaphXr4Kucs5GeNTuj8E2/90KPUaigfQlm3YUw6bXIgh6b5jCfHsbbX56PPw+ca+tPg== Date: Thu, 25 Jan 2018 08:24:26 -0500 From: Arvind Sankar To: Arnaldo Carvalho de Melo Cc: Josh Poimboeuf , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Peter Zijlstra , Ingo Molnar Subject: Re: [PATCH] tools: libsubcmd: Drop the less hack that was inherited from Git. Message-ID: <20180125132425.GA27283@rani.riverdale> References: <20180124003831.GA34667@rani.riverdale> <20180124205411.lpzcpqnuw3nlyg4n@treble> <20180125081652.GA23548@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180125081652.GA23548@kernel.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1590432180841544172?= X-GMAIL-MSGID: =?utf-8?q?1590570958026258192?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: Thanks. This was found because gcc 8 appears to be enabling -Wrestrict in -Wall, so there is a build failure with mainline gcc. On Thu, Jan 25, 2018 at 05:16:52AM -0300, Arnaldo Carvalho de Melo wrote: > Em Wed, Jan 24, 2018 at 02:54:11PM -0600, Josh Poimboeuf escreveu: > > On Tue, Jan 23, 2018 at 07:38:37PM -0500, Arvind Sankar wrote: > > > We inherited this hack with the original code from the Git project. The > > > select call is invalid as the two fd_set pointers should not be aliased. > > > > > > We could fix it, but the Git project removed this hack in 2012 in commit > > > e8320f3 (pager: drop "wait for output to run less" hack). The bug it > > > worked around was apparently fixed in less back in June 2007. > > > > > > So remove the hack from here as well. > > > > > > Signed-off-by: Arvind Sankar > > > > Looks good to me. > > > > Acked-by: Josh Poimboeuf > > > > Libsubcmd is used by perf and objtool, so adding the perf maintainers to > > CC. Arnaldo, do you want to pick this one up? > > Sure, I'll put it in my perf/core branch. > > - Arnaldo > > > > --- > > > tools/lib/subcmd/pager.c | 17 ----------------- > > > tools/lib/subcmd/run-command.c | 2 -- > > > tools/lib/subcmd/run-command.h | 1 - > > > 3 files changed, 20 deletions(-) > > > > > > diff --git a/tools/lib/subcmd/pager.c b/tools/lib/subcmd/pager.c > > > index 5ba754d17952..94d61d9b511f 100644 > > > --- a/tools/lib/subcmd/pager.c > > > +++ b/tools/lib/subcmd/pager.c > > > @@ -1,5 +1,4 @@ > > > // SPDX-License-Identifier: GPL-2.0 > > > -#include > > > #include > > > #include > > > #include > > > @@ -23,21 +22,6 @@ void pager_init(const char *pager_env) > > > subcmd_config.pager_env = pager_env; > > > } > > > > > > -static void pager_preexec(void) > > > -{ > > > - /* > > > - * Work around bug in "less" by not starting it until we > > > - * have real input > > > - */ > > > - fd_set in; > > > - > > > - FD_ZERO(&in); > > > - FD_SET(0, &in); > > > - select(1, &in, NULL, &in, NULL); > > > - > > > - setenv("LESS", "FRSX", 0); > > > -} > > > - > > > static const char *pager_argv[] = { "sh", "-c", NULL, NULL }; > > > static struct child_process pager_process; > > > > > > @@ -84,7 +68,6 @@ void setup_pager(void) > > > pager_argv[2] = pager; > > > pager_process.argv = pager_argv; > > > pager_process.in = -1; > > > - pager_process.preexec_cb = pager_preexec; > > > > > > if (start_command(&pager_process)) > > > return; > > > diff --git a/tools/lib/subcmd/run-command.c b/tools/lib/subcmd/run-command.c > > > index 5cdac2162532..9e9dca717ed7 100644 > > > --- a/tools/lib/subcmd/run-command.c > > > +++ b/tools/lib/subcmd/run-command.c > > > @@ -120,8 +120,6 @@ int start_command(struct child_process *cmd) > > > unsetenv(*cmd->env); > > > } > > > } > > > - if (cmd->preexec_cb) > > > - cmd->preexec_cb(); > > > if (cmd->exec_cmd) { > > > execv_cmd(cmd->argv); > > > } else { > > > diff --git a/tools/lib/subcmd/run-command.h b/tools/lib/subcmd/run-command.h > > > index 17d969c6add3..6256268802b5 100644 > > > --- a/tools/lib/subcmd/run-command.h > > > +++ b/tools/lib/subcmd/run-command.h > > > @@ -46,7 +46,6 @@ struct child_process { > > > unsigned no_stderr:1; > > > unsigned exec_cmd:1; /* if this is to be external sub-command */ > > > unsigned stdout_to_stderr:1; > > > - void (*preexec_cb)(void); > > > }; > > > > > > int start_command(struct child_process *); > > > -- > > > 2.13.6 > > > > > > > -- > > Josh