aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-09-15 08:33:45 +0000
committerEric Andersen <andersen@codepoet.org>2003-09-15 08:33:45 +0000
commit8efe967018dd79aacfe3ca1e2583f115d744e466 (patch)
tree7590704be6cf03c87242043f5909e12eb4150356 /networking
parentc4f72d1426e03f046ac54a00d733a4a52c3a5d4b (diff)
downloadbusybox-8efe967018dd79aacfe3ca1e2583f115d744e466.tar.gz
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.c10
-rw-r--r--networking/wget.c11
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 @@
#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 @@ extern int telnet_main(int argc, char** argv)
#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
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)
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
@@ -841,7 +838,7 @@ progressmeter(int flag)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: wget.c,v 1.59 2003/09/11 08:25:11 andersen Exp $
+ * $Id: wget.c,v 1.60 2003/09/15 08:33:37 andersen Exp $
*/