From 8f82c3ea68d955b6e231772d74d6e226aacd6931 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Wed, 16 Sep 1998 18:20:23 +0000 Subject: [PATCH] vmstat shows all manually-specified devices rather then just the first three. --- usr.bin/vmstat/vmstat.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index 7f37b95a3548..6119fb7fba37 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)vmstat.c 8.1 (Berkeley) 6/6/93"; #endif static const char rcsid[] = - "$Id: vmstat.c,v 1.24 1998/07/06 21:01:54 bde Exp $"; + "$Id: vmstat.c,v 1.25 1998/09/15 08:16:43 gibbs Exp $"; #endif /* not lint */ #include @@ -154,6 +154,7 @@ devstat_select_mode select_mode; struct vmmeter sum, osum; int winlines = 20; +int nflag = 0; kvm_t *kd; @@ -212,6 +213,7 @@ main(argc, argv) nlistf = optarg; break; case 'n': + nflag = 1; maxshowdevs = atoi(optarg); if (maxshowdevs < 0) errx(1, "number of devices %d is < 0", @@ -349,6 +351,9 @@ getdrivedata(argv) } dev_select = NULL; + if (nflag == 0 && maxshowdevs < num_devices_specified) + maxshowdevs = num_devices_specified; + /* * People are generally only interested in disk statistics when * they're running vmstat. So, that's what we're going to give