[BusyBox-cvs] busybox/networking telnet.c, 1.37, 1.38 wget.c, 1.59, 1.60

Erik Andersen andersen at busybox.net
Mon Sep 15 08:33:41 UTC 2003


Update of /var/cvs/busybox/networking
In directory winder:/tmp/cvs-serv10511/networking

Modified Files:
	telnet.c wget.c 
Log Message:
Be entirely consistant when using ioctl(0, TIOCGWINSZ, &winsize)
to ensure proper fallback behavior on, i.e. serial consoles.
 -Erik


Index: telnet.c
===================================================================
RCS file: /var/cvs/busybox/networking/telnet.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- telnet.c	14 Jul 2003 21:21:01 -0000	1.37
+++ telnet.c	15 Sep 2003 08:33:37 -0000	1.38
@@ -44,10 +44,6 @@
 #include <netinet/in.h>
 #include "busybox.h"
 
-#ifdef CONFIG_FEATURE_AUTOWIDTH
-#   include <sys/ioctl.h>
-#endif
-
 #if 0
 static const int DOTRACE = 1;
 #endif
@@ -585,11 +581,7 @@
 #endif	
 
 #ifdef CONFIG_FEATURE_AUTOWIDTH
-    struct winsize winp;
-    if( ioctl(0, TIOCGWINSZ, &winp) == 0 ) {
-	win_width  = winp.ws_col;
-	win_height = winp.ws_row;
-    }
+	get_terminal_width_height(0, &win_width, &win_height);
 #endif
 
 #ifdef CONFIG_FEATURE_TELNET_TTYPE

Index: wget.c
===================================================================
RCS file: /var/cvs/busybox/networking/wget.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- wget.c	11 Sep 2003 08:25:11 -0000	1.59
+++ wget.c	15 Sep 2003 08:33:37 -0000	1.60
@@ -679,12 +679,9 @@
 static int
 getttywidth(void)
 {
-	struct winsize winsize;
-
-	if (ioctl(fileno(stdout), TIOCGWINSZ, &winsize) != -1)
-		return (winsize.ws_col ? winsize.ws_col : 80);
-	else
-		return (80);
+	int width=0;
+	get_terminal_width_height(0, &width, NULL);
+	return (width);
 }
 
 static void




More information about the busybox-cvs mailing list