File 0003-ps-restore-thread-display-when-using-a-pidlist-optio.patch of Package procps
From cb945cf3056cf6140554d54efa21436cfffdfba3 Mon Sep 17 00:00:00 2001
From: Jim Warner <james.warner@comcast.net>
Date: Wed, 30 Mar 2022 12:00:00 -0500
Subject: [PATCH 3/3] ps: restore thread display when using a pidlist option
This commit will once again display threads when using
the -L option along with any of those pidlist options.
Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/234
Signed-off-by: Jim Warner <james.warner@comcast.net>
---
ps/display.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ps/display.c b/ps/display.c
index 75c7d926..2e1cc665 100644
--- a/ps/display.c
+++ b/ps/display.c
@@ -289,9 +289,12 @@ static void simple_spew(void){
// -q option (only single SEL_PID_QUICK typecode entry expected in the list, if present)
if (selection_list && selection_list->typecode == SEL_PID_QUICK) {
unsigned *pidlist = xcalloc(selection_list->n, sizeof(unsigned));
+ enum pids_select_type which;
for (i = 0; i < selection_list->n; i++)
pidlist[i] = selection_list->u[selection_list->n-i-1].pid;
- pidread = procps_pids_select(Pids_info, pidlist, selection_list->n, PIDS_SELECT_PID);
+ which = (thread_flags & (TF_loose_tasks|TF_show_task))
+ ? PIDS_SELECT_PID_THREADS : PIDS_SELECT_PID;
+ pidread = procps_pids_select(Pids_info, pidlist, selection_list->n, which);
free(pidlist);
} else {
enum pids_fetch_type which;
--
2.32.0