summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkstailey <kstailey@openbsd.org>1998-11-28 02:37:35 +0000
committerkstailey <kstailey@openbsd.org>1998-11-28 02:37:35 +0000
commite39249f91084890d82f61afc850fa5b5fb56526c (patch)
tree3c5f92bb77e66c001aae0587a24046f9594bf913
parentno debug by default (diff)
downloadwireguard-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.c10
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;
+ }
}
/*