diff options
author | 2013-12-13 22:54:08 +0000 | |
---|---|---|
committer | 2013-12-13 22:54:08 +0000 | |
commit | e3aa6d2f42ee1541b3c80d438a34bf369049d320 (patch) | |
tree | de68b34ad90d617bebeb49d9302d2e1cfb6b84d5 | |
parent | Give format specifiers their own subsection, so that we can reference it (diff) | |
download | wireguard-openbsd-e3aa6d2f42ee1541b3c80d438a34bf369049d320.tar.xz wireguard-openbsd-e3aa6d2f42ee1541b3c80d438a34bf369049d320.zip |
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> |