[git commit master 1/1] top: add tie breaking for topmem mode
Denys Vlasenko
vda.linux at googlemail.com
Tue Jul 13 10:13:04 UTC 2010
commit: http://git.busybox.net/busybox/commit/?id=a95ce93e578958ad84c51d8cc01d18afed9bc6f2
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
procps/top.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/procps/top.c b/procps/top.c
index 04dd826..ec84374 100644
--- a/procps/top.c
+++ b/procps/top.c
@@ -686,10 +686,10 @@ static int topmem_sort(char *a, char *b)
n = offsetof(topmem_status_t, vsz) + (sort_field * sizeof(mem_t));
l = *(mem_t*)(a + n);
r = *(mem_t*)(b + n);
-// if (l == r) {
-// l = a->mapped_rw;
-// r = b->mapped_rw;
-// }
+ if (l == r) {
+ l = ((topmem_status_t*)a)->dirty;
+ r = ((topmem_status_t*)b)->dirty;
+ }
/* We want to avoid unsigned->signed and truncation errors */
/* l>r: -1, l=r: 0, l<r: 1 */
n = (l > r) ? -1 : (l != r);
--
1.7.1
More information about the busybox-cvs
mailing list