aboutsummaryrefslogtreecommitdiff
path: root/util-linux/more.c
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-04-18 00:00:52 +0000
committerErik Andersen <andersen@codepoet.org>2000-04-18 00:00:52 +0000
commita6c752201e9031b51a6d89349f1cec1f690f56ef (patch)
tree808a54e0dc112d8b32326ccdb411e4300dc65d76 /util-linux/more.c
parent91e581fa0438b39ceb0ffb4ddcb90ee4d260ae81 (diff)
downloadbusybox-a6c752201e9031b51a6d89349f1cec1f690f56ef.tar.gz
Updates
-Erik
Diffstat (limited to 'util-linux/more.c')
-rw-r--r--util-linux/more.c22
1 files changed, 5 insertions, 17 deletions
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 <termio.h>
-# define termios termio
-# define stty(fd,argp) ioctl(fd,TCSETAF,argp)
-#else
-# include <termios.h>
-# define stty(fd,argp) tcsetattr(fd,TCSANOW,argp)
-#endif
+#include <termio.h>
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);