Skip to content

Commit 3969cc0

Browse files
olsajiriacmel
authored andcommitted
perf top: Use set_term_quiet() instead of open coded equivalent
Signed-off-by: Jiri Olsa <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Corey Ashford <[email protected]> Cc: David Ahern <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jean Pihet <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/n/[email protected] [ Yanked this out of a patch containing this and some other change ] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 179033b commit 3969cc0

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

tools/perf/builtin-top.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -433,18 +433,13 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c)
433433

434434
if (!perf_top__key_mapped(top, c)) {
435435
struct pollfd stdin_poll = { .fd = 0, .events = POLLIN };
436-
struct termios tc, save;
436+
struct termios save;
437437

438438
perf_top__print_mapped_keys(top);
439439
fprintf(stdout, "\nEnter selection, or unmapped key to continue: ");
440440
fflush(stdout);
441441

442-
tcgetattr(0, &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);
442+
set_term_quiet_input(&save);
448443

449444
poll(&stdin_poll, 1, -1);
450445
c = getc(stdin);

0 commit comments

Comments
 (0)