aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2016-05-04 18:43:19 -0500
committerRob Landley <rob@landley.net>2016-05-04 18:43:19 -0500
commit676e1d93cf3943cbbe91a0fad9b319cff9b136b1 (patch)
tree86394ea7b952746a7ff5fdcff10ffa60a0786fcb /toys
parent454eea52f806141137ff62abaf78302ea3d7c9c0 (diff)
downloadtoybox-676e1d93cf3943cbbe91a0fad9b319cff9b136b1.tar.gz
Elliott says -T should fetch threads even when not displaying thread fields.
Diffstat (limited to 'toys')
-rw-r--r--toys/posix/ps.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/toys/posix/ps.c b/toys/posix/ps.c
index 7843ffa5..3a39353a 100644
--- a/toys/posix/ps.c
+++ b/toys/posix/ps.c
@@ -1134,7 +1134,8 @@ void ps_main(void)
if (!(toys.optflags&(FLAG_k|FLAG_M))) TT.show_process = (void *)show_ps;
TT.match_process = ps_match_process;
dt = dirtree_read("/proc",
- (TT.bits&(_PS_TID|_PS_TCNT)) ? get_threads : get_ps);
+ ((toys.optflags&FLAG_T) || (TT.bits&(_PS_TID|_PS_TCNT)))
+ ? get_threads : get_ps);
if (toys.optflags&(FLAG_k|FLAG_M)) {
struct carveup **tbsort = collate(TT.kcount, dt);