From deb63adf945d446ed91a9d84124c71f15ae571d1 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Mon, 13 Feb 2023 00:39:04 -0600 Subject: [PATCH] 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). MFC after: 3 days Reviewed by: pstef (D37083) --- usr.bin/top/machine.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index 315c8be1a4c..be667ec0e46 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 };