diff options
author | 1998-11-28 02:37:35 +0000 | |
---|---|---|
committer | 1998-11-28 02:37:35 +0000 | |
commit | e39249f91084890d82f61afc850fa5b5fb56526c (patch) | |
tree | 3c5f92bb77e66c001aae0587a24046f9594bf913 | |
parent | no debug by default (diff) | |
download | wireguard-openbsd-e39249f91084890d82f61afc850fa5b5fb56526c.tar.xz wireguard-openbsd-e39249f91084890d82f61afc850fa5b5fb56526c.zip |
do not count swap spaces that were not swapon(2)ed
-rw-r--r-- | usr.bin/top/machine.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index a4279b29b6d..be632694ca4 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machine.c,v 1.13 1998/09/20 06:19:14 niklas Exp $ */ +/* $OpenBSD: machine.c,v 1.14 1998/11/28 02:37:35 kstailey Exp $ */ /* * top - a top users display for Unix @@ -983,9 +983,11 @@ int *total; for (i = 0; i < nswdev; i++) { int xsize, xfree; - xsize = sw[i].sw_nblks; - xfree = perdev[i]; - *total += xsize; + if (sw[i].sw_flags & SW_FREED) { + xsize = sw[i].sw_nblks; + xfree = perdev[i]; + *total += xsize; + } } /* |