summaryrefslogtreecommitdiff
path: root/usr.bin/systat
diff options
context:
space:
mode:
authorMartijn van Duren <martijn@cvs.openbsd.org>2018-02-08 13:22:26 +0000
committerMartijn van Duren <martijn@cvs.openbsd.org>2018-02-08 13:22:26 +0000
commit27ad11ad9996cfc845c70c483ba8ce22fd242fb9 (patch)
tree76e0c6e0b52f74a148ecae3829aa4edf202c2079 /usr.bin/systat
parent2df627dc6a50bf2976d6a49755b8f2d8a6f0ffc9 (diff)
Make pool order on size actually order on size instead of size*inuse.
Prompted by and OK otto@
Diffstat (limited to 'usr.bin/systat')
-rw-r--r--usr.bin/systat/pool.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/usr.bin/systat/pool.c b/usr.bin/systat/pool.c
index 99b28b8e7da..bbe49af107e 100644
--- a/usr.bin/systat/pool.c
+++ b/usr.bin/systat/pool.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pool.c,v 1.15 2017/07/31 04:23:30 dlg Exp $ */
+/* $OpenBSD: pool.c,v 1.16 2018/02/08 13:22:25 martijn Exp $ */
/*
* Copyright (c) 2008 Can Erkin Acar <canacar@openbsd.org>
*
@@ -245,19 +245,13 @@ int
sort_psize_callback(const void *s1, const void *s2)
{
struct pool_info *p1, *p2;
- size_t ps1, ps2;
p1 = (struct pool_info *)s1;
p2 = (struct pool_info *)s2;
- ps1 = (size_t)(p1->pool.pr_nget - p1->pool.pr_nput) *
- (size_t)p1->pool.pr_size;
- ps2 = (size_t)(p2->pool.pr_nget - p2->pool.pr_nput) *
- (size_t)p2->pool.pr_size;
-
- if (ps1 < ps2)
+ if (p1->pool.pr_size < p2->pool.pr_size)
return sortdir;
- if (ps1 > ps2)
+ if (p1->pool.pr_size > p2->pool.pr_size)
return -sortdir;
return sort_npage_callback(s1, s2);