MFp4 @229085:

Rearrange the code so we don't call ioctl(TIOCGWINSZ) if the -s option is given,
as the result won't be used then.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Pawel Jakub Dawidek 2013-05-28 21:21:46 +00:00
parent e2e9c35fa4
commit 4b0ae51212
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=251072

View File

@ -1205,6 +1205,11 @@ ktrgenio(struct ktr_genio *ktr, int len)
static int screenwidth = 0;
int i, binary;
printf("fd %d %s %d byte%s\n", ktr->ktr_fd,
ktr->ktr_rw == UIO_READ ? "read" : "wrote", datalen,
datalen == 1 ? "" : "s");
if (suppressdata)
return;
if (screenwidth == 0) {
struct winsize ws;
@ -1214,11 +1219,6 @@ ktrgenio(struct ktr_genio *ktr, int len)
else
screenwidth = 80;
}
printf("fd %d %s %d byte%s\n", ktr->ktr_fd,
ktr->ktr_rw == UIO_READ ? "read" : "wrote", datalen,
datalen == 1 ? "" : "s");
if (suppressdata)
return;
if (maxdata && datalen > maxdata)
datalen = maxdata;