aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2014-08-15 15:24:45 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-08-24 07:11:18 -0400
commit3969cc094a9dbb40e624b259caa73c7a2056b249 (patch)
tree0211e948cb63bafd1168016175d75ec2622698a5 /tools
parent179033b3e064d2cd3f5f9945e76b0a0f0fbf4883 (diff)
perf top: Use set_term_quiet() instead of open coded equivalent
Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jean Pihet <jean.pihet@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/n/tip-h7n9te70flmaqfnj6l06ay6r@git.kernel.org [ Yanked this out of a patch containing this and some other change ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/builtin-top.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index a77ff6ca5fbd..9848e270b92c 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -433,18 +433,13 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c)
433 433
434 if (!perf_top__key_mapped(top, c)) { 434 if (!perf_top__key_mapped(top, c)) {
435 struct pollfd stdin_poll = { .fd = 0, .events = POLLIN }; 435 struct pollfd stdin_poll = { .fd = 0, .events = POLLIN };
436 struct termios tc, save; 436 struct termios save;
437 437
438 perf_top__print_mapped_keys(top); 438 perf_top__print_mapped_keys(top);
439 fprintf(stdout, "\nEnter selection, or unmapped key to continue: "); 439 fprintf(stdout, "\nEnter selection, or unmapped key to continue: ");
440 fflush(stdout); 440 fflush(stdout);
441 441
442 tcgetattr(0, &save); 442 set_term_quiet_input(&save);
443 tc = save;
444 tc.c_lflag &= ~(ICANON | ECHO);
445 tc.c_cc[VMIN] = 0;
446 tc.c_cc[VTIME] = 0;
447 tcsetattr(0, TCSANOW, &tc);
448 443
449 poll(&stdin_poll, 1, -1); 444 poll(&stdin_poll, 1, -1);
450 c = getc(stdin); 445 c = getc(stdin);