[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5376C17E.60403@gmail.com>
Date: Fri, 16 May 2014 19:55:10 -0600
From: David Ahern <dsahern@...il.com>
To: Stephane Eranian <eranian@...gle.com>, linux-kernel@...r.kernel.org
CC: peterz@...radead.org, mingo@...e.hu, acme@...hat.com,
jolsa@...hat.com, namhyung.kim@...nel.org,
Michael Lentine <mlentine@...gle.com>
Subject: Re: [PATCH 1/2] perf tools: add cat as fallback pager
On 5/16/14, 5:14 PM, Stephane Eranian wrote:
> From: Michael Lentine <mlentine@...gle.com>
>
> This patch adds a fallback to cat for the pager. This is useful
> on environmnents, such as Android, where less does not exist.
> It is better to default to cat than to abort.
>
> Reviewed-by: Stephane Eranian <eranian@...gle.com>
> Signed-off-by: Michael Lentine <mlentine@...gle.com>
> ---
> tools/perf/util/pager.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/tools/perf/util/pager.c b/tools/perf/util/pager.c
> index 3322b84..5feec3d 100644
> --- a/tools/perf/util/pager.c
> +++ b/tools/perf/util/pager.c
> @@ -57,13 +57,13 @@ void setup_pager(void)
> }
> if (!pager)
> pager = getenv("PAGER");
> - if (!pager) {
> - if (!access("/usr/bin/pager", X_OK))
> - pager = "/usr/bin/pager";
> - }
> - if (!pager)
> + if (!(pager || access("/usr/bin/pager", X_OK)))
> + pager = "/usr/bin/pager";
> + if (!(pager || access("/usr/bin/less", X_OK)))
> pager = "less";
If you check for /usr/bin/less shouldn't the full path be used here?
David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists