From: Michael Lentine <mlentine@xxxxxxxxxx>
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@xxxxxxxxxx>
Signed-off-by: Michael Lentine <mlentine@xxxxxxxxxx>
---
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";