]> granicus.if.org Git - procps-ng/commitdiff
top: share the rcfile between master & newlib branches
authorJim Warner <james.warner@comcast.net>
Tue, 7 Jun 2016 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Thu, 9 Jun 2016 10:51:06 +0000 (20:51 +1000)
Since the decision was made to also add that Linux-4.5
support (was only in this newlib branch) to our master
branch, a tweak to newlib's top is necessary. In order
to share the rcfile between them, any fields unique to
a branch must appear last in it's list of enumerators.

And the troublesome field in question above is CGNAME.

It doesn't matter if a unique field is on or off, only
that it, as a higher enum/char, appear after all other
shared fields. Otherwise one risks the 'corrupt' error
message from the top without that field or the display
of the wrong column in the top with that unique field.

[ and strictly speaking, the changes under top_nls.c ]
[ were technically not really necessary. however, we ]
[ choose to maintain strict ordering via enum value. ]

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

index ed70f0a58985b7896f7019486e10588b8cf6da7c..d20f8fd3a7a1b6beaa3b56d7fd721edf4a788fc6 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -1559,7 +1559,6 @@ static struct {
    {    10,     -1,  A_right,    -1,  PROCPS_PIDS_NS_USER       },  // ul_int   EU_NS5
    {    10,     -1,  A_right,    -1,  PROCPS_PIDS_NS_UTS        },  // ul_int   EU_NS6
    {     8,     -1,  A_left,     -1,  PROCPS_PIDS_LXCNAME       },  // str      EU_LXC
-   {    -1,     -1,  A_left,     -1,  PROCPS_PIDS_CGNAME        },  // str      EU_CGN
 #ifndef NOBOOST_MEMS
    {     6,  SK_Kb,  A_right,    -1,  PROCPS_PIDS_VM_RSS_ANON   },  // sl_int   EU_RZA
    {     6,  SK_Kb,  A_right,    -1,  PROCPS_PIDS_VM_RSS_FILE   },  // sl_int   EU_RZF
@@ -1571,7 +1570,8 @@ static struct {
    {     4,  SK_Kb,  A_right,    -1,  PROCPS_PIDS_VM_RSS_LOCKED },  // sl_int   EU_RZL
    {     4,  SK_Kb,  A_right,    -1,  PROCPS_PIDS_VM_RSS_SHARED },  // sl_int   EU_RZS
 #endif
-#define eu_LAST        EU_RZS                                       //  ( the last real pflag, currently )
+   {    -1,     -1,  A_left,     -1,  PROCPS_PIDS_CGNAME        },  // str      EU_CGN
+#define eu_LAST        EU_CGN                                       //  ( the last real pflag, currently )
 // xtra Fieldstab 'pseudo pflag' entries for the newlib interface . . . ----------------------------------
 #define eu_CMDLINE     eu_LAST +1
 #define eu_TICS_ALL_C  eu_LAST +2
index aa3ad0432def965d0c293f49e311db6de231ffd5..230208b3ae723c796d4d03fd73d1bf24b0500224 100644 (file)
--- a/top/top.h
+++ b/top/top.h
@@ -180,8 +180,9 @@ enum pflag {
    EU_FV1, EU_FV2,
    EU_USE,
    EU_NS1, EU_NS2, EU_NS3, EU_NS4, EU_NS5, EU_NS6,
-   EU_LXC, EU_CGN,
+   EU_LXC,
    EU_RZA, EU_RZF, EU_RZL, EU_RZS,
+   EU_CGN,
 #ifdef USE_X_COLHDR
    // not really pflags, used with tbl indexing
    EU_MAXPFLGS
index 39ab5fdce7f3b0563f1eee5b68dc7af5fc57b05f..e89b8e09877b4d94b66e852de5fc6260526533fe 100644 (file)
@@ -278,9 +278,6 @@ static void build_two_nlstabs (void) {
 /* Translation Hint: maximum 'LXC' = 7 */
    Head_nlstab[EU_LXC] = _("LXC");
    Desc_nlstab[EU_LXC] = _("LXC container name");
-/* Translation Hint: maximum 'CGNAME' = 7 */
-   Head_nlstab[EU_CGN] = _("CGNAME");
-   Desc_nlstab[EU_CGN] = _("Control Group name");
 /* Translation Hint: maximum 'RSan' = 4 */
    Head_nlstab[EU_RZA] = _("RSan");
    Desc_nlstab[EU_RZA] = _("RES Anonymous (KiB)");
@@ -293,6 +290,9 @@ static void build_two_nlstabs (void) {
 /* Translation Hint: maximum 'RSsh' = 4 */
    Head_nlstab[EU_RZS] = _("RSsh");
    Desc_nlstab[EU_RZS] = _("RES Shared (KiB)");
+/* Translation Hint: maximum 'CGNAME' = 7 */
+   Head_nlstab[EU_CGN] = _("CGNAME");
+   Desc_nlstab[EU_CGN] = _("Control Group name");
 }