From f0064ac18fdb516d0babd1976324ce5a0d8fb6cb Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Tue, 11 Oct 2016 00:00:00 -0500 Subject: [PATCH] top: tweak some stuff relating to non-displayed fields 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 --- top/top.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/top/top.c b/top/top.c index e282e2d3..d66376e2 100644 --- 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;