summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1997-11-08 23:36:44 +0000
committermillert <millert@openbsd.org>1997-11-08 23:36:44 +0000
commite7d99f5ed6e8a2eb85e1206efddb61fc253e7788 (patch)
tree5cf41b3a8ffc66713a763d5661d7d2bedffd64bf
parentspelling (diff)
downloadwireguard-openbsd-e7d99f5ed6e8a2eb85e1206efddb61fc253e7788.tar.xz
wireguard-openbsd-e7d99f5ed6e8a2eb85e1206efddb61fc253e7788.zip
Sort idle processes by total CPU usage, not cpticks since cpticks
get zeroed every second; dan@dan.emsphone.com
-rw-r--r--usr.bin/top/machine.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c
index 5ebb907859b..198588914a7 100644
--- a/usr.bin/top/machine.c
+++ b/usr.bin/top/machine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machine.c,v 1.7 1997/09/09 15:23:13 millert Exp $ */
+/* $OpenBSD: machine.c,v 1.8 1997/11/08 23:36:44 millert Exp $ */
/*
* top - a top users display for Unix
@@ -600,8 +600,8 @@ const void *v1, *v2;
/* compare percent cpu (pctcpu) */
if ((lresult = PP(p2, p_pctcpu) - PP(p1, p_pctcpu)) == 0)
{
- /* use cpticks to break the tie */
- if ((result = PP(p2, p_cpticks) - PP(p1, p_cpticks)) == 0)
+ /* use CPU usage to break the tie */
+ if ((result = PP(p2, p_rtime).tv_sec - PP(p1, p_rtime).tv_sec) == 0)
{
/* use process state to break the tie */
if ((result = sorted_state[(unsigned char) PP(p2, p_stat)] -