summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/sade/termcap.c8
-rw-r--r--usr.sbin/sysinstall/termcap.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/usr.sbin/sade/termcap.c b/usr.sbin/sade/termcap.c
index 5cf0f27..3e80a41 100644
--- a/usr.sbin/sade/termcap.c
+++ b/usr.sbin/sade/termcap.c
@@ -39,7 +39,7 @@ set_termcap(void)
{
char *term;
int stat;
- struct ttysize ts;
+ struct winsize ws;
term = getenv("TERM");
stat = ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay);
@@ -95,10 +95,10 @@ set_termcap(void)
}
#endif
}
- if (ioctl(0, TIOCGSIZE, &ts) == -1) {
+ if (ioctl(0, TIOCGWINSZ, &ws) == -1) {
msgDebug("Unable to get terminal size - errno %d\n", errno);
- ts.ts_lines = 0;
+ ws.ws_row = 0;
}
- StatusLine = ts.ts_lines ? ts.ts_lines - 1: (OnVTY ? VTY_STATUS_LINE : TTY_STATUS_LINE);
+ StatusLine = ws.ws_row ? ws.ws_row - 1: (OnVTY ? VTY_STATUS_LINE : TTY_STATUS_LINE);
return 0;
}
diff --git a/usr.sbin/sysinstall/termcap.c b/usr.sbin/sysinstall/termcap.c
index ca5905a..0df0a77 100644
--- a/usr.sbin/sysinstall/termcap.c
+++ b/usr.sbin/sysinstall/termcap.c
@@ -75,7 +75,7 @@ set_termcap(void)
{
char *term;
int stat;
- struct ttysize ts;
+ struct winsize ws;
term = getenv("TERM");
stat = ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay);
@@ -141,10 +141,10 @@ set_termcap(void)
}
#endif
}
- if (ioctl(0, TIOCGSIZE, &ts) == -1) {
+ if (ioctl(0, TIOCGWINSZ, &ws) == -1) {
msgDebug("Unable to get terminal size - errno %d\n", errno);
- ts.ts_lines = 0;
+ ws.ws_row = 0;
}
- StatusLine = ts.ts_lines ? ts.ts_lines - 1: (OnVTY ? VTY_STATUS_LINE : TTY_STATUS_LINE);
+ StatusLine = ws.ws_row ? ws.ws_row - 1: (OnVTY ? VTY_STATUS_LINE : TTY_STATUS_LINE);
return 0;
}
OpenPOWER on IntegriCloud