summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall/termcap.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-08-01 13:47:03 +0000
committerjkh <jkh@FreeBSD.org>1996-08-01 13:47:03 +0000
commitc8828e74f3c111d17105e9bed360338954f02836 (patch)
treed9a1a8ea339fdb9423e3da4446f33963f744d0a7 /usr.sbin/sysinstall/termcap.c
parent6b1c559b52e523520a110e418b96fa9cd0402be5 (diff)
downloadFreeBSD-src-c8828e74f3c111d17105e9bed360338954f02836.zip
FreeBSD-src-c8828e74f3c111d17105e9bed360338954f02836.tar.gz
Whoops! VTYs return zero values for TIOCGSIZE! Work around this.
Diffstat (limited to 'usr.sbin/sysinstall/termcap.c')
-rw-r--r--usr.sbin/sysinstall/termcap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/sysinstall/termcap.c b/usr.sbin/sysinstall/termcap.c
index 8888ee9..06aca6c 100644
--- a/usr.sbin/sysinstall/termcap.c
+++ b/usr.sbin/sysinstall/termcap.c
@@ -82,8 +82,8 @@ set_termcap(void)
}
if (ioctl(0, TIOCGSIZE, &ts) == -1) {
msgDebug("Unable to get terminal size - errno %d\n", errno);
- ts.ts_lines = OnVTY ? VTY_STATUS_LINE : TTY_STATUS_LINE;
+ ts.ts_lines = 0;
}
- StatusLine = ts.ts_lines;
+ StatusLine = ts.ts_lines ? ts.ts_lines : (OnVTY ? VTY_STATUS_LINE : TTY_STATUS_LINE);
return 0;
}
OpenPOWER on IntegriCloud