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>
This commit is contained in:
Jim Warner 2022-03-30 12:00:00 -05:00 committed by Craig Small
parent 8cb646bdfc
commit e914f4b068

View File

@ -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;