From a6c752201e9031b51a6d89349f1cec1f690f56ef Mon Sep 17 00:00:00 2001 From: Erik Andersen Date: Tue, 18 Apr 2000 00:00:52 +0000 Subject: Updates -Erik --- util-linux/more.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'util-linux') diff --git a/util-linux/more.c b/util-linux/more.c index d5711aa2f..f84214905 100644 --- a/util-linux/more.c +++ b/util-linux/more.c @@ -33,25 +33,17 @@ static const char more_usage[] = "more [file ...]\n"; -/* ED: sparc termios is broken: revert back to old termio handling. */ #ifdef BB_FEATURE_USE_TERMIOS -#if #cpu(sparc) -# define USE_OLD_TERMIO -# include -# define termios termio -# define stty(fd,argp) ioctl(fd,TCSETAF,argp) -#else -# include -# define stty(fd,argp) tcsetattr(fd,TCSANOW,argp) -#endif +#include FILE *cin; -struct termios initial_settings, new_settings; +/* sparc and other have broken termios support: use old termio handling. */ +struct termio initial_settings, new_settings; void gotsig(int sig) { - stty(fileno(cin), &initial_settings); + ioctl(fileno(cin), TCSETAF, &initial_settings); fprintf(stdout, "\n"); exit(TRUE); } @@ -106,15 +98,11 @@ extern int more_main(int argc, char **argv) cin = fopen("/dev/tty", "r"); if (!cin) cin = fopen("/dev/console", "r"); -#ifdef USE_OLD_TERMIO ioctl(fileno(cin), TCGETA, &initial_settings); -#else - tcgetattr(fileno(cin), &initial_settings); -#endif new_settings = initial_settings; new_settings.c_lflag &= ~ICANON; new_settings.c_lflag &= ~ECHO; - stty(fileno(cin), &new_settings); + ioctl(fileno(cin), TCSETAF, &new_settings); #ifdef BB_FEATURE_AUTOWIDTH ioctl(fileno(stdout), TIOCGWINSZ, &win); -- cgit v1.2.3