summaryrefslogtreecommitdiffstats
path: root/usr.bin/vmstat
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2008-01-18 22:09:44 +0000
committerpeter <peter@FreeBSD.org>2008-01-18 22:09:44 +0000
commitedc23a8104a888ea49121b63cb35431f2a3dc487 (patch)
treec64de3ee93676d37374590deee8e81eedce667e6 /usr.bin/vmstat
parent11e3c3ef90703f732668185265927e677353d306 (diff)
downloadFreeBSD-src-edc23a8104a888ea49121b63cb35431f2a3dc487.zip
FreeBSD-src-edc23a8104a888ea49121b63cb35431f2a3dc487.tar.gz
Fix some boolean logic errors. && vs & and other sillyness. *blush*
This would prevent it from skipping non-present cpus in -P output. Submitted by: Pieter de Goeje <pieter@degoeje.nl>
Diffstat (limited to 'usr.bin/vmstat')
-rw-r--r--usr.bin/vmstat/vmstat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
index 0c7bd72..2d7eff4 100644
--- a/usr.bin/vmstat/vmstat.c
+++ b/usr.bin/vmstat/vmstat.c
@@ -739,7 +739,7 @@ printhdr(int ncpus, u_long cpumask)
(void)printf(" faults ");
if (Pflag) {
for (i = 0; i < ncpus; i++) {
- if (cpumask && (1ul << i))
+ if (cpumask & (1ul << i))
printf("cpu%-2d ", i);
}
printf("\n");
@@ -976,7 +976,7 @@ pcpustats(int ncpus, u_long cpumask, int maxid)
/* devstats does this for cp_time */
for (i = 0; i <= maxid; i++) {
- if (cpumask && (1ul << i) == 0)
+ if ((cpumask & (1ul << i)) == 0)
continue;
for (state = 0; state < CPUSTATES; ++state) {
tmp = cur_cp_times[i * CPUSTATES + state];
@@ -987,7 +987,7 @@ pcpustats(int ncpus, u_long cpumask, int maxid)
over = 0;
for (i = 0; i <= maxid; i++) {
- if (cpumask && (1ul << i) == 0)
+ if ((cpumask & (1ul << i)) == 0)
continue;
total = 0;
for (state = 0; state < CPUSTATES; ++state)
OpenPOWER on IntegriCloud