aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/iostat
diff options
context:
space:
mode:
authorMaxim Konovalov <maxim@FreeBSD.org>2007-08-03 15:45:55 +0000
committerMaxim Konovalov <maxim@FreeBSD.org>2007-08-03 15:45:55 +0000
commitdd9bccc4791eabcaa05b89abdeccaa3534ac2dbc (patch)
tree59334a7b9fa47e66f508b4976fd00103047bdbf1 /usr.sbin/iostat
parent2174a10b9ea67f8f64cf9435aaf9f833b0abebc2 (diff)
downloadsrc-dd9bccc4791eabcaa05b89abdeccaa3534ac2dbc.tar.gz
src-dd9bccc4791eabcaa05b89abdeccaa3534ac2dbc.zip
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
Notes
Notes: svn path=/head/; revision=171709
Diffstat (limited to 'usr.sbin/iostat')
-rw-r--r--usr.sbin/iostat/iostat.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c
index b38c6dc6290e..111d927d24bf 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");