aboutsummaryrefslogtreecommitdiff
path: root/util-linux/more.c
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux/more.c')
-rw-r--r--util-linux/more.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/util-linux/more.c b/util-linux/more.c
index 7fa60bdba..debad81bd 100644
--- a/util-linux/more.c
+++ b/util-linux/more.c
@@ -43,7 +43,6 @@ struct globals {
43 unsigned terminal_width; 43 unsigned terminal_width;
44 unsigned terminal_height; 44 unsigned terminal_height;
45 struct termios initial_settings; 45 struct termios initial_settings;
46 struct termios new_settings;
47} FIX_ALIASING; 46} FIX_ALIASING;
48#define G (*(struct globals*)bb_common_bufsiz1) 47#define G (*(struct globals*)bb_common_bufsiz1)
49#define INIT_G() do { setup_common_bufsiz(); } while (0) 48#define INIT_G() do { setup_common_bufsiz(); } while (0)
@@ -101,12 +100,9 @@ int more_main(int argc UNUSED_PARAM, char **argv)
101 return bb_cat(argv); 100 return bb_cat(argv);
102 101
103 G.tty_fileno = fileno(tty); 102 G.tty_fileno = fileno(tty);
104 tcgetattr(G.tty_fileno, &G.initial_settings); 103
105 G.new_settings = G.initial_settings; 104 /* Turn on unbuffered input; turn off echoing */
106 G.new_settings.c_lflag &= ~(ICANON | ECHO); 105 set_termios_to_raw(G.tty_fileno, &G.initial_settings, 0);
107 G.new_settings.c_cc[VMIN] = 1;
108 G.new_settings.c_cc[VTIME] = 0;
109 tcsetattr_tty_TCSANOW(&G.new_settings);
110 bb_signals(BB_FATAL_SIGS, gotsig); 106 bb_signals(BB_FATAL_SIGS, gotsig);
111 107
112 do { 108 do {