From 082dadce554e8a37eb34ea1f9a727feadea04073 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 8 Jun 2016 17:03:26 -0700 Subject: HACK: restore Android ps behavior. "NAME" is no longer doing what we want; "TNAME" is what "NAME" used to be, except that "TNAME" implies -T. This patch switches us over to "TNAME", disables the implicit -T. Change-Id: I5553703d3939b24eaf39976162d2f75a591e1ce8 --- toys/posix/ps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toys/posix/ps.c b/toys/posix/ps.c index 4c66bcd6..9402b779 100644 --- a/toys/posix/ps.c +++ b/toys/posix/ps.c @@ -1194,7 +1194,7 @@ void ps_main(void) else if (toys.optflags&FLAG_l) not_o = "F,S,UID,%sPPID,C,PRI,NI,ADDR,SZ,WCHAN,TTY,TIME,CMD"; else if (CFG_TOYBOX_ON_ANDROID) - not_o = "USER,%sPPID,VSIZE,RSS,WCHAN:10,ADDR:10=PC,S,NAME"; + not_o = "USER,%sPPID,VSIZE,RSS,WCHAN:10,ADDR:10=PC,S,TNAME"; sprintf(toybuf, not_o, (toys.optflags & FLAG_T) ? "PID,TID," : "PID,"); // Init TT.fields. This only uses toybuf if TT.ps.o is NULL @@ -1227,7 +1227,7 @@ 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", - ((toys.optflags&FLAG_T) || (TT.bits&(_PS_TID|_PS_TCNT|_PS_TNAME))) + ((toys.optflags&FLAG_T) || (TT.bits&(_PS_TID|_PS_TCNT/*|_PS_TNAME*/))) ? get_threads : get_ps); if (toys.optflags&(FLAG_k|FLAG_M)) { -- cgit v1.2.3