summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Stanislawski <l.stanislaws@samsung.com>2018-07-25 15:56:17 +0200
committerLukasz Stanislawski <l.stanislaws@samsung.com>2018-07-25 15:57:56 +0200
commita5a4457844358cae0c35f757c37527716c087329 (patch)
treea5f252ae5acdb93eb52eca49f8708e6aacf121e1
parent3eaef9c1845ecd7707b2d1e76a40a2c7b189f79d (diff)
downloadttsd-worker-task-a5a4457844358cae0c35f757c37527716c087329.tar.gz
ttsd-worker-task-a5a4457844358cae0c35f757c37527716c087329.tar.bz2
ttsd-worker-task-a5a4457844358cae0c35f757c37527716c087329.zip
report-generator-top: change sorting condition
Change-Id: I3a6a71d0ec24ef55e51ccedf218212dbdb90405a
-rw-r--r--src/generators/report-generator-top.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/generators/report-generator-top.c b/src/generators/report-generator-top.c
index de9f7f5..888e889 100644
--- a/src/generators/report-generator-top.c
+++ b/src/generators/report-generator-top.c
@@ -105,7 +105,7 @@ static int _sort_by_cpu_usage(struct process *proc1, struct process *proc2)
if (process_get_cpu_usage(proc2, &usage2) != 0) {
return -1;
}
- return usage2 - usage1;
+ return usage2 > usage1 ? 1 : -1;
}
static int _sort_by_memory_usage(struct process *proc1, struct process *proc2)
@@ -117,7 +117,7 @@ static int _sort_by_memory_usage(struct process *proc1, struct process *proc2)
if (process_get_memory_usage(proc2, &usage2) != 0) {
return -1;
}
- return usage2 - usage1;
+ return usage2 > usage1 ? 1 : -1;
}
static int _report_generator_top_report_generator_scan_apps(