diff options
author | Erik Andersen <andersen@codepoet.org> | 2000-04-18 00:00:52 +0000 |
---|---|---|
committer | Erik Andersen <andersen@codepoet.org> | 2000-04-18 00:00:52 +0000 |
commit | a6c752201e9031b51a6d89349f1cec1f690f56ef (patch) | |
tree | 808a54e0dc112d8b32326ccdb411e4300dc65d76 /util-linux/more.c | |
parent | 91e581fa0438b39ceb0ffb4ddcb90ee4d260ae81 (diff) | |
download | busybox-w32-a6c752201e9031b51a6d89349f1cec1f690f56ef.tar.gz busybox-w32-a6c752201e9031b51a6d89349f1cec1f690f56ef.tar.bz2 busybox-w32-a6c752201e9031b51a6d89349f1cec1f690f56ef.zip |
Updates
-Erik
Diffstat (limited to 'util-linux/more.c')
-rw-r--r-- | util-linux/more.c | 22 |
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 @@ | |||
33 | 33 | ||
34 | static const char more_usage[] = "more [file ...]\n"; | 34 | static const char more_usage[] = "more [file ...]\n"; |
35 | 35 | ||
36 | /* ED: sparc termios is broken: revert back to old termio handling. */ | ||
37 | #ifdef BB_FEATURE_USE_TERMIOS | 36 | #ifdef BB_FEATURE_USE_TERMIOS |
38 | 37 | ||
39 | #if #cpu(sparc) | 38 | #include <termio.h> |
40 | # define USE_OLD_TERMIO | ||
41 | # include <termio.h> | ||
42 | # define termios termio | ||
43 | # define stty(fd,argp) ioctl(fd,TCSETAF,argp) | ||
44 | #else | ||
45 | # include <termios.h> | ||
46 | # define stty(fd,argp) tcsetattr(fd,TCSANOW,argp) | ||
47 | #endif | ||
48 | 39 | ||
49 | FILE *cin; | 40 | FILE *cin; |
50 | struct termios initial_settings, new_settings; | 41 | /* sparc and other have broken termios support: use old termio handling. */ |
42 | struct termio initial_settings, new_settings; | ||
51 | 43 | ||
52 | void gotsig(int sig) | 44 | void gotsig(int sig) |
53 | { | 45 | { |
54 | stty(fileno(cin), &initial_settings); | 46 | ioctl(fileno(cin), TCSETAF, &initial_settings); |
55 | fprintf(stdout, "\n"); | 47 | fprintf(stdout, "\n"); |
56 | exit(TRUE); | 48 | exit(TRUE); |
57 | } | 49 | } |
@@ -106,15 +98,11 @@ extern int more_main(int argc, char **argv) | |||
106 | cin = fopen("/dev/tty", "r"); | 98 | cin = fopen("/dev/tty", "r"); |
107 | if (!cin) | 99 | if (!cin) |
108 | cin = fopen("/dev/console", "r"); | 100 | cin = fopen("/dev/console", "r"); |
109 | #ifdef USE_OLD_TERMIO | ||
110 | ioctl(fileno(cin), TCGETA, &initial_settings); | 101 | ioctl(fileno(cin), TCGETA, &initial_settings); |
111 | #else | ||
112 | tcgetattr(fileno(cin), &initial_settings); | ||
113 | #endif | ||
114 | new_settings = initial_settings; | 102 | new_settings = initial_settings; |
115 | new_settings.c_lflag &= ~ICANON; | 103 | new_settings.c_lflag &= ~ICANON; |
116 | new_settings.c_lflag &= ~ECHO; | 104 | new_settings.c_lflag &= ~ECHO; |
117 | stty(fileno(cin), &new_settings); | 105 | ioctl(fileno(cin), TCSETAF, &new_settings); |
118 | 106 | ||
119 | #ifdef BB_FEATURE_AUTOWIDTH | 107 | #ifdef BB_FEATURE_AUTOWIDTH |
120 | ioctl(fileno(stdout), TIOCGWINSZ, &win); | 108 | ioctl(fileno(stdout), TIOCGWINSZ, &win); |