]> granicus.if.org Git - procps-ng/commit
library: repair <pids> api boo-boo in the 'select' i/f
authorJim Warner <james.warner@comcast.net>
Sat, 7 Aug 2021 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Mon, 9 Aug 2021 12:03:23 +0000 (22:03 +1000)
commitaf34cc964ae7667db15d2507f24098c26ba3c664
tree1dd8922382219bb410a378614a2993a5954c766d
parenta37526260917bac624ae6b75fd9f4ea7287d81ad
library: repair <pids> api boo-boo in the 'select' i/f

The patch referenced below corrected some flaws in the
procps_pids_select implementation. But, there remained
one flaw which this commit will now hopefully address.

Rather than assume callers wished to select only tasks
and not threads meant a command like 'top -H -p 10329'
works differently under newlib than release 3.3.17. It
fails to honor the '-H' (threads) switch under newlib.

So, to fix that oops, we'll allow that select function
to get threads or tasks depending on its 'which' parm.

Reference(s):
. Oct 2015, some flaws corrected
commit bc616b361596bc3008800de839b88446508cfdd0

Signed-off-by: Jim Warner <james.warner@comcast.net>
proc/pids.c
proc/pids.h
proc/readproc.c