diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-07-13 12:13:04 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-07-13 12:13:04 +0200 |
commit | a95ce93e578958ad84c51d8cc01d18afed9bc6f2 (patch) | |
tree | 30fe4694632585b8bdf05021d3463a9814aacb5e /procps | |
parent | 6af732b9ae841b05a70242004811d25476fa7b54 (diff) | |
download | busybox-w32-a95ce93e578958ad84c51d8cc01d18afed9bc6f2.tar.gz busybox-w32-a95ce93e578958ad84c51d8cc01d18afed9bc6f2.tar.bz2 busybox-w32-a95ce93e578958ad84c51d8cc01d18afed9bc6f2.zip |
top: add tie breaking for topmem mode
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'procps')
-rw-r--r-- | procps/top.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/procps/top.c b/procps/top.c index 04dd82633..ec8437442 100644 --- a/procps/top.c +++ b/procps/top.c | |||
@@ -686,10 +686,10 @@ static int topmem_sort(char *a, char *b) | |||
686 | n = offsetof(topmem_status_t, vsz) + (sort_field * sizeof(mem_t)); | 686 | n = offsetof(topmem_status_t, vsz) + (sort_field * sizeof(mem_t)); |
687 | l = *(mem_t*)(a + n); | 687 | l = *(mem_t*)(a + n); |
688 | r = *(mem_t*)(b + n); | 688 | r = *(mem_t*)(b + n); |
689 | // if (l == r) { | 689 | if (l == r) { |
690 | // l = a->mapped_rw; | 690 | l = ((topmem_status_t*)a)->dirty; |
691 | // r = b->mapped_rw; | 691 | r = ((topmem_status_t*)b)->dirty; |
692 | // } | 692 | } |
693 | /* We want to avoid unsigned->signed and truncation errors */ | 693 | /* We want to avoid unsigned->signed and truncation errors */ |
694 | /* l>r: -1, l=r: 0, l<r: 1 */ | 694 | /* l>r: -1, l=r: 0, l<r: 1 */ |
695 | n = (l > r) ? -1 : (l != r); | 695 | n = (l > r) ? -1 : (l != r); |