diff options
author | ed <ed@FreeBSD.org> | 2008-05-23 14:24:33 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2008-05-23 14:24:33 +0000 |
commit | 82e712d5edb03f4ce70cf2a4e76084b692dc32cd (patch) | |
tree | 2d2798e036e6e624e5f1a19ee5f52df09041e35b /usr.sbin/sysinstall/termcap.c | |
parent | bb95365b8cc204ca60208f60048aec80c9810ba4 (diff) | |
download | FreeBSD-src-82e712d5edb03f4ce70cf2a4e76084b692dc32cd.zip FreeBSD-src-82e712d5edb03f4ce70cf2a4e76084b692dc32cd.tar.gz |
Move sysinstall/sade away from TIOCGSIZE.
Both sysinstall and sade still seem to use the TIOCGSIZE ioctl to obtain
the terminal dimensions. We'd better use TIOCGWINSZ to do this. The
TIOCGWINSZ interface is preferred, because it also allows sizes in pixels
to be passed to the application (though this is not used here).
Approved by: philip (mentor)
Diffstat (limited to 'usr.sbin/sysinstall/termcap.c')
-rw-r--r-- | usr.sbin/sysinstall/termcap.c | 8 |
1 files changed, 4 insertions, 4 deletions
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; } |