summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@cvs.openbsd.org>2013-12-13 22:54:09 +0000
committerChristian Weisgerber <naddy@cvs.openbsd.org>2013-12-13 22:54:09 +0000
commit53a5840ac2887725f5afe558a788a62d315eca4b (patch)
tree43fec581c9dff762f3ac3736169e5aa679267ba3 /lib
parenta21e8417f971217b206859523e512344244603b0 (diff)
Remove struct ttysize which was introduced for compatibility with
SunOS < 3.2 (1986). ok millert@, guenther@
Diffstat (limited to 'lib')
-rw-r--r--lib/libocurses/setterm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libocurses/setterm.c b/lib/libocurses/setterm.c
index 488c3916681..1b430b44155 100644
--- a/lib/libocurses/setterm.c
+++ b/lib/libocurses/setterm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: setterm.c,v 1.7 2005/08/14 17:15:19 espie Exp $ */
+/* $OpenBSD: setterm.c,v 1.8 2013/12/13 22:54:08 naddy Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
* The Regents of the University of California. All rights reserved.
@@ -81,7 +81,7 @@ setterm(type)
static char genbuf[1024];
static char __ttytype[1024];
register int unknown;
- struct ttysize win;
+ struct winsize win;
char *p;
#ifdef DEBUG
@@ -100,10 +100,10 @@ setterm(type)
#endif
/* Try TIOCGSIZE, and, if it fails, the termcap entry. */
- if (ioctl(STDERR_FILENO, TIOCGSIZE, &win) != -1 &&
- win.ts_lines != 0 && win.ts_cols != 0) {
- LINES = win.ts_lines;
- COLS = win.ts_cols;
+ if (ioctl(STDERR_FILENO, TIOCGWINSZ, &win) != -1 &&
+ win.ws_row != 0 && win.ws_col != 0) {
+ LINES = win.ws_row;
+ COLS = win.ws_col;
} else {
LINES = tgetnum("li");
COLS = tgetnum("co");