diff options
author | Christian Weisgerber <naddy@cvs.openbsd.org> | 2013-12-13 22:54:09 +0000 |
---|---|---|
committer | Christian Weisgerber <naddy@cvs.openbsd.org> | 2013-12-13 22:54:09 +0000 |
commit | 53a5840ac2887725f5afe558a788a62d315eca4b (patch) | |
tree | 43fec581c9dff762f3ac3736169e5aa679267ba3 | |
parent | a21e8417f971217b206859523e512344244603b0 (diff) |
Remove struct ttysize which was introduced for compatibility with
SunOS < 3.2 (1986). ok millert@, guenther@
-rw-r--r-- | lib/libocurses/setterm.c | 12 | ||||
-rw-r--r-- | sys/sys/ioctl.h | 18 |
2 files changed, 7 insertions, 23 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"); diff --git a/sys/sys/ioctl.h b/sys/sys/ioctl.h index a9db3153a95..73514b634d5 100644 --- a/sys/sys/ioctl.h +++ b/sys/sys/ioctl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ioctl.h,v 1.14 2013/12/13 19:55:12 naddy Exp $ */ +/* $OpenBSD: ioctl.h,v 1.15 2013/12/13 22:54:08 naddy Exp $ */ /* $NetBSD: ioctl.h,v 1.20 1996/01/30 18:21:47 thorpej Exp $ */ /*- @@ -41,23 +41,7 @@ #define _SYS_IOCTL_H_ #include <sys/ttycom.h> - -/* - * Pun for SunOS prior to 3.2. SunOS 3.2 and later support TIOCGWINSZ - * and TIOCSWINSZ (yes, even 3.2-3.5, the fact that it wasn't documented - * nonwithstanding). - */ -struct ttysize { - unsigned short ts_lines; - unsigned short ts_cols; - unsigned short ts_xxx; - unsigned short ts_yyy; -}; -#define TIOCGSIZE TIOCGWINSZ -#define TIOCSSIZE TIOCSWINSZ - #include <sys/ioccom.h> - #include <sys/filio.h> #include <sys/sockio.h> |