From 7f1466fea9595335290c3d4c767bbf5f2c348c37 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Wed, 15 Jan 1997 21:16:58 +0000 Subject: [PATCH] Use `get_window_size' git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1163 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/telnet/telnet/sys_bsd.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/appl/telnet/telnet/sys_bsd.c b/appl/telnet/telnet/sys_bsd.c index 3071afeb6..9af2d1c51 100644 --- a/appl/telnet/telnet/sys_bsd.c +++ b/appl/telnet/telnet/sys_bsd.c @@ -44,16 +44,28 @@ RCSID("$Id$"); */ +#ifdef HAVE_FCNTL_H #include +#endif +#ifdef HAVE_SYS_TYPES_H #include +#endif #ifdef HAVE_SYS_SELECT_H #include #endif +#ifdef HAVE_SYS_TIME_H #include +#endif +#ifdef HAVE_SYS_SOCKET_H #include +#endif #include #include +#ifdef HAVE_ARPA_TELNET_H #include +#endif + +#include #include "ring.h" @@ -644,16 +656,14 @@ TerminalSpeeds(ispeed, ospeed) TerminalWindowSize(rows, cols) long *rows, *cols; { -#ifdef TIOCGWINSZ struct winsize ws; - if (ioctl(fileno(stdin), TIOCGWINSZ, (char *)&ws) >= 0) { + if (get_window_size (STDIN_FILENO, &ws) == 0) { *rows = ws.ws_row; *cols = ws.ws_col; return 1; - } -#endif /* TIOCGWINSZ */ - return 0; + } else + return 0; } int