Commit ea1b3eba authored by Avik Sil's avatar Avik Sil Committed by Arnaldo Carvalho de Melo

perf tools: Fix pager on minimal-install embedded systems

Some Distributions may lack "less" package being included by default,
e.g., Linaro nano rootfs. In those cases use the portable "pager"
command instead of "less".
Signed-off-by: default avatarAvik Sil <avik.sil@linaro.org>
Acked-by: default avatarIngo Molnar <mingo@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1338287725-26382-1-git-send-email-avik.sil@linaro.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent f1439c31
...@@ -57,6 +57,10 @@ void setup_pager(void) ...@@ -57,6 +57,10 @@ void setup_pager(void)
} }
if (!pager) if (!pager)
pager = getenv("PAGER"); pager = getenv("PAGER");
if (!pager) {
if (!access("/usr/bin/pager", X_OK))
pager = "/usr/bin/pager";
}
if (!pager) if (!pager)
pager = "less"; pager = "less";
else if (!*pager || !strcmp(pager, "cat")) else if (!*pager || !strcmp(pager, "cat"))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment