Received: by 10.223.176.5 with SMTP id f5csp94474wra; Thu, 8 Feb 2018 17:18:33 -0800 (PST) X-Google-Smtp-Source: AH8x227XEol3ir2hPOPUawYb+lCjy56/9kyk401DhUU8n2dKc2KQtdlk1xyywW0hYYkPtEtKd5ep X-Received: by 10.98.172.21 with SMTP id v21mr1005226pfe.66.1518139113673; Thu, 08 Feb 2018 17:18:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518139113; cv=none; d=google.com; s=arc-20160816; b=rTUNR8ja56gz0H9GeEy0DOVsLxqPMt8hqLB1W5/2cbpoZxJP7Lut3st8nqT9GGBb/C Lf4iWQgovkFisBUsqnPwE6772tyYVY9VVlwOCufSOovtR6N7UV7QNB6zGmP0uDG3ufQB vb0FGkF4th+BkCCv0VeYqRXMZr+iFoQWE6pnr01Wy9l+bJeuNhamAdETLTdEeeAhkHfA ovfkget5nQUjkeri09qM4b4ttT2k2ay8/0l/RAX4vTp/oEOpupgp/d/PFu0BDZkefwMN p8RLRru4YLXPfKaTS20QaOPIy1wd/xaOhaRGzC8i6t2TM+LXNUG5ycrS1FBJn29MCmBT kPJw== 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:dmarc-filter:arc-authentication-results; bh=n5oSBjD7fi0rFoD2jEcdMOoz3owsqUevA03Fm3L2Trc=; b=isMBTyWyKUM765QCrfyAyzzt7xheKq7EbbqjGl+xHdfifAhBUI1/tOX1eaNZWItke1 HztZzSD3m7SqdYpXf5IapnqMVmmUEKHlLb26N43s13xacL1S2OMzUMr5Tn4CPxwHZDaJ pHLLoQ0dA4poBjL62euIJfIJvaBl929llDUb+rOnqnsVHd8tEws+LUckiH18tsO4jRFq YyJl4YgTNwvD2JKQS2Ibwc/4YD1hnHYAsMfF61xezqzd+ux5EBJ1LairWvN2retBU251 /K+KyJDKmoUYKqhTiJujEeG/YIjz5IJ01ZHjYsmAAIOLs6AlNyk5RDoTvbv6uJyA+gRP SCvA== 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 p11-v6si768464plr.644.2018.02.08.17.18.19; Thu, 08 Feb 2018 17:18:33 -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 S1752468AbeBIBRd (ORCPT + 99 others); Thu, 8 Feb 2018 20:17:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:33062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752154AbeBIBRc (ORCPT ); Thu, 8 Feb 2018 20:17:32 -0500 Received: from jouet.infradead.org (unknown [179.97.41.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C98CA21789; Fri, 9 Feb 2018 01:17:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C98CA21789 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org Received: by jouet.infradead.org (Postfix, from userid 1000) id AC134144FC4; Thu, 8 Feb 2018 22:17:28 -0300 (-03) Date: Thu, 8 Feb 2018 22:17:28 -0300 From: Arnaldo Carvalho de Melo To: Arvind Sankar 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: <20180209011728.GB5132@kernel.org> References: <20180124003831.GA34667@rani.riverdale> <20180124205411.lpzcpqnuw3nlyg4n@treble> <20180125081652.GA23548@kernel.org> <20180209000009.GA54330@rani.riverdale> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180209000009.GA54330@rani.riverdale> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, Feb 08, 2018 at 07:00:10PM -0500, Arvind Sankar escreveu: > 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. Ok, so e8320f3 was merged directly by Linus, I'll wait till perf/urgent pulls from upstream and then will merge this, Thanks, - Arnaldo > Signed-off-by: Arvind Sankar > --- > - Merge with commit ad343a98 (tools/lib/subcmd/pager.c: do not alias > select() params) by Sergey > > tools/lib/subcmd/pager.c | 20 -------------------- > tools/lib/subcmd/run-command.c | 2 -- > tools/lib/subcmd/run-command.h | 1 - > 3 files changed, 23 deletions(-) > > diff --git a/tools/lib/subcmd/pager.c b/tools/lib/subcmd/pager.c > index 9997a8805a82..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,24 +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_set exception; > - > - FD_ZERO(&in); > - FD_ZERO(&exception); > - FD_SET(0, &in); > - FD_SET(0, &exception); > - select(1, &in, NULL, &exception, NULL); > - > - setenv("LESS", "FRSX", 0); > -} > - > static const char *pager_argv[] = { "sh", "-c", NULL, NULL }; > static struct child_process pager_process; > > @@ -87,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