]> granicus.if.org Git - procps-ng/commitdiff
top: ensure necessary proc_t support if '-U' filtering
authorJim Warner <james.warner@comcast.net>
Thu, 15 Jun 2017 17:00:00 +0000 (12:00 -0500)
committerCraig Small <csmall@enc.com.au>
Tue, 4 Jul 2017 10:29:25 +0000 (20:29 +1000)
While the effective user id would always be present in
each proc_t, thus supporting 'u' filtering, other user
ids would only be present if /proc/$$/status was read.

This commit just puts the 'master' branch top on a par
with the 'newlib' branch when user filtering with 'U'.

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c

index 8f85c4aff84aed8f8589bfa81883cf988e3bed8c..8c3bd05a6d9212c43576c3814cd41361aa36215b 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -1918,6 +1918,8 @@ static void build_headers (void) {
          f = w->rc.sortindx;
          Frames_libflags |= Fieldstab[f].lflg;
          if (EU_CMD == f && CHKw(w, Show_CMDLIN)) Frames_libflags |= L_CMDLINE;
+         // for 'U' filtering we need the other user ids too
+         if (w->usrseltyp == 'U') Frames_libflags |= L_status;
       } // end: VIZISw(w)
 
       if (Rc.mode_altscr) w = w->next;