aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2023-02-13 06:39:04 +0000
committerKyle Evans <kevans@FreeBSD.org>2023-02-16 04:53:44 +0000
commitb7a3f47bffd2f15d4b0d2cc3a36852bed6960595 (patch)
tree635c33e665eeaeff23565fe0f9401e2a4904b274
parent5ad8ebc3a3a51b6726364788e42f49d36b4048d3 (diff)
downloadsrc-b7a3f47bffd2f15d4b0d2cc3a36852bed6960595.tar.gz
src-b7a3f47bffd2f15d4b0d2cc3a36852bed6960595.zip
top: fix sorting by pid (-o pid)
The 'pid' order was added, but the equivalent comparator was not back in 8b800d3af2d8c ("Add the PID column to the list of sort keys."). `ordernames` indices need to match `compares` indices in order for this to work. A future commit will restructure all of this to make it less error prone going forward (see D37083). Reviewed by: pstef (D37083) Approved by: re (cperciva) (cherry picked from commit deb63adf945d446ed91a9d84124c71f15ae571d1) (cherry picked from commit cfd3bd04c245889d339c4f7cb1e45c955537e3eb)
-rw-r--r--usr.bin/top/machine.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c
index 315c8be1a4c2..be667ec0e461 100644
--- a/usr.bin/top/machine.c
+++ b/usr.bin/top/machine.c
@@ -1567,6 +1567,7 @@ int (*compares[])(const void *arg1, const void *arg2) = {
compare_ivcsw,
compare_jid,
compare_swap,
+ compare_pid,
NULL
};