From efcbbe93ea33fa0a602a85985e1bc9fb5ecbe790 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Mon, 7 Sep 2015 00:00:00 -0500 Subject: [PATCH] top: plug a rather big hole in the display fields dike Whoa, guess what field got overlooked in that march to the newlib conversion? It was the TTY guy. However, it wasn't completely top's fault - that newlib must share at least some responsibility, for only offering a num. [ and while we're at it, let's touch up the man page ] [ to agree with ol' newlib's current implementation. ] Signed-off-by: Jim Warner --- top/top.1 | 8 -------- top/top.c | 5 +++-- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/top/top.1 b/top/top.1 index 6bbbdd74..3c46f52c 100644 --- a/top/top.1 +++ b/top/top.1 @@ -81,7 +81,6 @@ top \- display Linux processes .\" ---------------------------------------------------------------------- \*(WE \*(CL - The traditional switches `\-' and whitespace are optional. .\" ---------------------------------------------------------------------- @@ -905,7 +904,6 @@ last update (see nMaj). The number of\fB minor\fR page faults that have occurred since the last update (see nMin). - .\" ...................................................................... .SS 3b. MANAGING Fields .\" ---------------------------------------------------------------------- @@ -1537,11 +1535,6 @@ when running \*(We with column highlighting turned \*F. \ \ \ \fBR\fR\ \ :\fIReverse/Normal-Sort-Field\fR toggle \fR Using this \*(CI you can alternate between high-to-low and low-to-high sorts. -.PP -\*(NT Field sorting uses internal values, not those in column display. -Thus, the TTY and WCHAN fields will violate strict ASCII collating sequence. -.RE - .\" ...................................................................... .SS 4d. COLOR Mapping .\" ---------------------------------------------------------------------- @@ -2184,7 +2177,6 @@ The entries in the \*(We rcfile would have a number for the `.name' element and the `help' entry would identify a shell script you've written explaining what those numbered selections actually mean. In that way, many more choices can be made visible. - .PP .\" ---------------------------------------------------------------------- diff --git a/top/top.c b/top/top.c index 6dc9130f..8418896e 100644 --- a/top/top.c +++ b/top/top.c @@ -1527,7 +1527,7 @@ static struct { { 5, -1, A_right, 0, 0, PROCPS_PIDS_ID_EGID }, // u_int EU_GID { 8, -1, A_left, 0, 0, PROCPS_PIDS_ID_EGROUP }, // str EU_GRP { 0, -1, A_right, 0, 0, PROCPS_PIDS_ID_PGRP }, // s_int EU_PGD - { 8, -1, A_left, 0, 0, PROCPS_PIDS_TTY }, // s_int EU_TTY + { 8, -1, A_left, 0, 0, PROCPS_PIDS_TTY_NAME }, // str EU_TTY { 0, -1, A_right, 0, 0, PROCPS_PIDS_ID_TPGID }, // s_int EU_TPG { 0, -1, A_right, 0, 0, PROCPS_PIDS_ID_SESSION }, // s_int EU_SID { 3, -1, A_right, 0, 0, PROCPS_PIDS_PRIORITY }, // s_int EU_PRI @@ -5081,9 +5081,10 @@ static const char *task_show (const WIN_t *q, struct pids_stack *p) { cp = scale_tics(t, W, Jn); } break; - /* str, make_str */ + /* str, make_str (all AUTOX yes) */ case EU_GRP: case EU_LXC: + case EU_TTY: case EU_UEN: case EU_URN: case EU_USN: