public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Stephane Eranian <eranian@google.com>, linux-kernel@vger.kernel.org
Cc: peterz@infradead.org, mingo@elte.hu, acme@redhat.com,
	jolsa@redhat.com, namhyung.kim@kernel.org,
	Michael Lentine <mlentine@google.com>
Subject: Re: [PATCH 1/2] perf tools: add cat as fallback pager
Date: Fri, 16 May 2014 19:55:10 -0600	[thread overview]
Message-ID: <5376C17E.60403@gmail.com> (raw)
In-Reply-To: <1400282087-4616-2-git-send-email-eranian@google.com>

On 5/16/14, 5:14 PM, Stephane Eranian wrote:
> From: Michael Lentine <mlentine@google.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@google.com>
> Signed-off-by: Michael Lentine <mlentine@google.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

  reply	other threads:[~2014-05-17  1:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16 23:14 [PATCH 0/2] perf tools: improve perf support on Android Stephane Eranian
2014-05-16 23:14 ` [PATCH 1/2] perf tools: add cat as fallback pager Stephane Eranian
2014-05-17  1:55   ` David Ahern [this message]
2014-05-16 23:14 ` [PATCH 2/2] perf tools: add automatic remapping of Android libraries Stephane Eranian
2014-05-19  9:58   ` Jiri Olsa
  -- strict thread matches above, loose matches on Subject: below --
2014-05-16 23:15 [PATCH 0/2] perf tools: improve perf support on Android Stephane Eranian
2014-05-16 23:15 ` [PATCH 1/2] perf tools: add cat as fallback pager Stephane Eranian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5376C17E.60403@gmail.com \
    --to=dsahern@gmail.com \
    --cc=acme@redhat.com \
    --cc=eranian@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mlentine@google.com \
    --cc=namhyung.kim@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox