Received: by 10.223.176.5 with SMTP id f5csp89501wra; Fri, 2 Feb 2018 17:27:29 -0800 (PST) X-Google-Smtp-Source: AH8x225O4PoDL+Wqnem9ivnZFWBpneFcdq416n0mQbDpfsQMxbjgv4VtvosqM0kIvpWqFGs8Vzmt X-Received: by 10.98.150.213 with SMTP id s82mr42247131pfk.10.1517621249037; Fri, 02 Feb 2018 17:27:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517621249; cv=none; d=google.com; s=arc-20160816; b=qpWxUC8cl3T1Lzv0fQn2UaoiCg9vV6P6Kp7Q0D+/9zYGABKdc3X+SSX2U4+glNIaQ2 tXQAbtG//zG+mV6TKKIv6fU/p5YgC72SiCPaIhCS7yYFrtclEAK+8dTVIIjKTfbi+bLI 0oG/25pFaHDfn3/JPEROEE/PKRTyBkZ+ttvR8vMGy9Q1AMj6Y2et9sFeO1RDtjzxSHCv rI0ljcAyKT1A7y2gFO7/A4fk+r65QloWItG7NVUjpuYbDUpJieu+6VLkSFGPPBgnGrvQ PAG2wiKg5SL6caGArTWWHSBtf5air2wV6HU0g0Rbg7qdFPU9u1EANaTz8/GfC21GBdqu Rmhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=dPZ+G9ofmSnfLrS0kTNjWbHSBdzfQ2EIC7v4uIegrbo=; b=eCCJmIPtMnqiUyefqqAKfnLsTBXewbXzBbWQgu6tVEYo95nv7YZy71AMrysKS3tPql v6tf30W1PHQqfCQkeaYrwqTETKSg2/OuWFlzkvs0JcDzr/2FdzSfx1qjsa4OuuBRgGWg NGCuYIG6xXKReKhcUjr0GUlOi5e0Dwdj51tPdc8zEquXaveEprJGKn/++ZLwsuXkco4U 4qugFkkpSj3CCkpPpXW+Mj61feNZ6Eyf+lubx4R4W+odUx+yDGZ1LAAWlYV3gWeSxDIZ CW5nGaGRpEa0cXUZ78gkWIYuY/0ZeERhI8Si3fHfSb1pzESc3ABjDhxDlsU023e3ltBt j6rg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s6si103244pgr.221.2018.02.02.17.27.14; Fri, 02 Feb 2018 17:27:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753012AbeBCAjB (ORCPT + 99 others); Fri, 2 Feb 2018 19:39:01 -0500 Received: from mail-qk0-f195.google.com ([209.85.220.195]:40739 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751715AbeBCAi5 (ORCPT ); Fri, 2 Feb 2018 19:38:57 -0500 Received: by mail-qk0-f195.google.com with SMTP id d18so26165689qke.7 for ; Fri, 02 Feb 2018 16:38:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=dPZ+G9ofmSnfLrS0kTNjWbHSBdzfQ2EIC7v4uIegrbo=; b=NfhA9cAWB9CkCdQMaArmKNxGYmjSU0r5zE/2s9ASR7fdiLDeCPpm8zmtx3WwfRrxHM pKjj+E/myLioykKju/EFA9o49WpOzLaQ4JcH/nb9uEnmayk5pKbhyIYynBSzh1TAjJSt lWPn2iMUO0fvmi82Oc+j6zPPR6AvBwG4iTa9J5fchV8yv4e2Q+pLmv2ts1WSRknnYiFG FiVHf1LMb1ocXOalaFW7fEyamYAlcozCevCsrZVuzWAHzPJjpgTfXQgcJ2yRHYQpbO/0 frzNk4wSRXqI31TprmFZzWUEipfpmBHY+DzaPFKUlW5SB7s8hmKh8uJdk0dltGK5Z3mr YHNw== X-Gm-Message-State: APf1xPCgbCOaWEXur+8rx8A1E/18EzTQ0lBmau3s+OvfFd1MMBrV+Iop zvHrliX9gCr7/LCIM72R+2Q= X-Received: by 10.55.197.133 with SMTP id k5mr1477205qkl.22.1517618336315; Fri, 02 Feb 2018 16:38:56 -0800 (PST) Received: from rani.riverdale (pool-100-8-221-136.nwrknj.fios.verizon.net. [100.8.221.136]) by smtp.gmail.com with ESMTPSA id d20sm2157032qtn.61.2018.02.02.16.38.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Feb 2018 16:38:55 -0800 (PST) Date: Fri, 2 Feb 2018 19:38:51 -0500 From: Arvind Sankar To: Arnaldo Carvalho de Melo Cc: Josh Poimboeuf , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Peter Zijlstra , Ingo Molnar , Sergey Senozhatsky Subject: Re: [PATCH] tools: libsubcmd: Drop the less hack that was inherited from Git. Message-ID: <20180203003850.GA62570@rani.riverdale> References: <20180124003831.GA34667@rani.riverdale> <20180124205411.lpzcpqnuw3nlyg4n@treble> <20180125081652.GA23548@kernel.org> <20180125132425.GA27283@rani.riverdale> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180125132425.GA27283@rani.riverdale> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, it looks like Sergey has put in a patch to fix the aliasing, looking at the linux-next tree. Are we still looking to remove this hack altogether? Thanks On Thu, Jan 25, 2018 at 08:24:26AM -0500, Arvind Sankar wrote: > 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