]> granicus.if.org Git - procps-ng/commitdiff
top: tweak some stuff relating to non-displayed fields
authorJim Warner <james.warner@comcast.net>
Tue, 11 Oct 2016 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@enc.com.au>
Sat, 15 Oct 2016 21:24:32 +0000 (08:24 +1100)
In the commit referenced below, in addition to several
tweaks to comments, 3 fields were no longer assured of
being present in the results stacks. However, 2 of the
3 fields might, in fact, be required even if they were
not currently being displayed in any of the 4 windows.

The PIDS_CMD is used in two separate 'Inspect' headers
('Y' command) and the PIDS_ID_EUID is required if that
'User Filter' ('u' or 'U' command) was being employed.

That latter field's inclusion will be made conditional
but the former field must be unconditionally included.

( for old top, PIDS_CMD would have always been there )

Reference(s):
commit 4e4debda9bd7a56c99c5a6ce80f6c7e1e0da79cd

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

index e282e2d38fc440ff16074c1e0b2f080a8939001d..d66376e2b863cd0088c72dc15ccbdfc571d494ea 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -1704,6 +1704,7 @@ static void build_headers (void) {
       Fieldstab[i].erel = -1;
    ckITEM(EU_PID);      // these 2 fields may not display,
    ckITEM(EU_STA);      // yet we'll always need them both
+   ckITEM(EU_CMD);      // this is used with 'Y' (inspect)
 
    do {
       if (VIZISw(w)) {
@@ -1747,7 +1748,7 @@ static void build_headers (void) {
          if (Fieldstab[EU_TME].erel > -1 && CHKw(w, Show_CTIMES)) ckITEM(eu_TICS_ALL_C);
          if (Fieldstab[EU_TM2].erel > -1 && CHKw(w, Show_CTIMES)) ckITEM(eu_TICS_ALL_C);
          // for 'u/U' filtering we need these too (old top forgot that, oops)
-         if (w->usrseltyp) { ckITEM(EU_URD); ckITEM(EU_USD); ckITEM(eu_ID_FUID); }
+         if (w->usrseltyp) { ckITEM(EU_UED); ckITEM(EU_URD); ckITEM(EU_USD); ckITEM(eu_ID_FUID); }
 
          // we must also accommodate an out of view sort field...
          f = w->rc.sortindx;