diff options
author | maxim <maxim@FreeBSD.org> | 2007-08-03 15:45:55 +0000 |
---|---|---|
committer | maxim <maxim@FreeBSD.org> | 2007-08-03 15:45:55 +0000 |
commit | 32aa3c3c0da1f6b4a0dab583a48ec99fdfbaf4fa (patch) | |
tree | 59334a7b9fa47e66f508b4976fd00103047bdbf1 /usr.sbin/iostat | |
parent | 46028ca18c22207c63b450bb9eee00b708985af0 (diff) | |
download | FreeBSD-src-32aa3c3c0da1f6b4a0dab583a48ec99fdfbaf4fa.zip FreeBSD-src-32aa3c3c0da1f6b4a0dab583a48ec99fdfbaf4fa.tar.gz |
o With -x switch do not pay attention at the hardcoded limit of 3 devices and dump stats for all devices in the system. User can still limit iostat -x by -n switch.
Spotted by: Igor Sysoev
Submitted by: kensmith
Approved by: re (kensmith)
MFC after: 2 weeks
Diffstat (limited to 'usr.sbin/iostat')
-rw-r--r-- | usr.sbin/iostat/iostat.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c index b38c6dc..111d927 100644 --- a/usr.sbin/iostat/iostat.c +++ b/usr.sbin/iostat/iostat.c @@ -281,11 +281,17 @@ main(int argc, char **argv) Tflag = 1; } + /* find out how many devices we have */ + if ((num_devices = devstat_getnumdevs(kd)) < 0) + err(1, "can't get number of devices"); + /* * Figure out how many devices we should display. */ if (nflag == 0) { - if (oflag > 0) { + if (xflag > 0) + maxshowdevs = num_devices; + else if (oflag > 0) { if ((dflag > 0) && (Cflag == 0) && (Tflag == 0)) maxshowdevs = 5; else if ((dflag > 0) && (Tflag > 0) && (Cflag == 0)) @@ -300,10 +306,6 @@ main(int argc, char **argv) } } - /* find out how many devices we have */ - if ((num_devices = devstat_getnumdevs(kd)) < 0) - err(1, "can't get number of devices"); - cur.dinfo = (struct devinfo *)malloc(sizeof(struct devinfo)); if (cur.dinfo == NULL) err(1, "malloc failed"); |