diff options
author | Eric Andersen <andersen@codepoet.org> | 2003-09-15 08:33:45 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2003-09-15 08:33:45 +0000 |
commit | 8efe967018dd79aacfe3ca1e2583f115d744e466 (patch) | |
tree | 7590704be6cf03c87242043f5909e12eb4150356 /networking | |
parent | c4f72d1426e03f046ac54a00d733a4a52c3a5d4b (diff) | |
download | busybox-w32-8efe967018dd79aacfe3ca1e2583f115d744e466.tar.gz busybox-w32-8efe967018dd79aacfe3ca1e2583f115d744e466.tar.bz2 busybox-w32-8efe967018dd79aacfe3ca1e2583f115d744e466.zip |
Be entirely consistant when using ioctl(0, TIOCGWINSZ, &winsize)
to ensure proper fallback behavior on, i.e. serial consoles.
-Erik
Diffstat (limited to 'networking')
-rw-r--r-- | networking/telnet.c | 10 | ||||
-rw-r--r-- | networking/wget.c | 11 |
2 files changed, 5 insertions, 16 deletions
diff --git a/networking/telnet.c b/networking/telnet.c index 88607f653..ac6ec98de 100644 --- a/networking/telnet.c +++ b/networking/telnet.c | |||
@@ -44,10 +44,6 @@ | |||
44 | #include <netinet/in.h> | 44 | #include <netinet/in.h> |
45 | #include "busybox.h" | 45 | #include "busybox.h" |
46 | 46 | ||
47 | #ifdef CONFIG_FEATURE_AUTOWIDTH | ||
48 | # include <sys/ioctl.h> | ||
49 | #endif | ||
50 | |||
51 | #if 0 | 47 | #if 0 |
52 | static const int DOTRACE = 1; | 48 | static const int DOTRACE = 1; |
53 | #endif | 49 | #endif |
@@ -585,11 +581,7 @@ extern int telnet_main(int argc, char** argv) | |||
585 | #endif | 581 | #endif |
586 | 582 | ||
587 | #ifdef CONFIG_FEATURE_AUTOWIDTH | 583 | #ifdef CONFIG_FEATURE_AUTOWIDTH |
588 | struct winsize winp; | 584 | get_terminal_width_height(0, &win_width, &win_height); |
589 | if( ioctl(0, TIOCGWINSZ, &winp) == 0 ) { | ||
590 | win_width = winp.ws_col; | ||
591 | win_height = winp.ws_row; | ||
592 | } | ||
593 | #endif | 585 | #endif |
594 | 586 | ||
595 | #ifdef CONFIG_FEATURE_TELNET_TTYPE | 587 | #ifdef CONFIG_FEATURE_TELNET_TTYPE |
diff --git a/networking/wget.c b/networking/wget.c index b1cc35e34..597d61097 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -679,12 +679,9 @@ static int ftpcmd(char *s1, char *s2, FILE *fp, char *buf) | |||
679 | static int | 679 | static int |
680 | getttywidth(void) | 680 | getttywidth(void) |
681 | { | 681 | { |
682 | struct winsize winsize; | 682 | int width=0; |
683 | 683 | get_terminal_width_height(0, &width, NULL); | |
684 | if (ioctl(fileno(stdout), TIOCGWINSZ, &winsize) != -1) | 684 | return (width); |
685 | return (winsize.ws_col ? winsize.ws_col : 80); | ||
686 | else | ||
687 | return (80); | ||
688 | } | 685 | } |
689 | 686 | ||
690 | static void | 687 | static void |
@@ -841,7 +838,7 @@ progressmeter(int flag) | |||
841 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 838 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
842 | * SUCH DAMAGE. | 839 | * SUCH DAMAGE. |
843 | * | 840 | * |
844 | * $Id: wget.c,v 1.59 2003/09/11 08:25:11 andersen Exp $ | 841 | * $Id: wget.c,v 1.60 2003/09/15 08:33:37 andersen Exp $ |
845 | */ | 842 | */ |
846 | 843 | ||
847 | 844 | ||