aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/newt.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-05-26 12:22:26 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-05-26 12:22:26 -0400
commit62e3436b5f3461662929eae102beefbd12127cb1 (patch)
treef106ccc10a03dd182edefe4717875bd787473840 /tools/perf/util/newt.c
parent49c177461bfbedeccbab22bf3905db2f9da7f1c3 (diff)
perf tui: Reset use_browser if stdout is not a tty
The newt initialization routines weren't being called because the output was a file (perf annotate > /tmp/bla) but use_browser was still 1, because ~/.perfconfig had it as 'on', so, later on newt routines segfaulted. Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/newt.c')
-rw-r--r--tools/perf/util/newt.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/util/newt.c b/tools/perf/util/newt.c
index d54c540f49db..cf182ca132fe 100644
--- a/tools/perf/util/newt.c
+++ b/tools/perf/util/newt.c
@@ -1139,6 +1139,7 @@ void setup_browser(void)
1139 struct newtPercentTreeColors *c = &defaultPercentTreeColors; 1139 struct newtPercentTreeColors *c = &defaultPercentTreeColors;
1140 1140
1141 if (!isatty(1) || !use_browser || dump_trace) { 1141 if (!isatty(1) || !use_browser || dump_trace) {
1142 use_browser = 0;
1142 setup_pager(); 1143 setup_pager();
1143 return; 1144 return;
1144 } 1145 }