[procps] Re: cgroup support for new top

  • From: Jim Warner <james.warner@xxxxxxxxxxx>
  • To: procps@xxxxxxxxxxxxx
  • Date: Fri, 15 Apr 2011 10:27:14 -0500

On Apr 15, 2011, at 9:05 AM, Dr. Werner Fink wrote:

> Maybe the define ZAP_SUSEONLY should be renamed as it
> could be that others also want to use this feature?

How about OOMEM_ENABLE (to retain consistent length)?

Jim

p.s. if you use the latest newtop, consider the patch below.  I promised Craig 
no more patches, so be sure not to tell him about this...


diff --git a/top.c b/top.c
index 434cc1b..e387a7b 100644
--- a/top.c
+++ b/top.c
@@ -194,7 +194,7 @@ static int   *PHash_sav = HHash_one,   // alternating 
'old/new' hash tables
          * Create string from cgroup array --
          * ( eventually to find a home in libproc ? ) */
 static void parse_cgroup (char *dst, size_t max, const proc_t *p) {
-   int whackable_int;
+   int whackable_int = max;
    char *ccgroup, *endp = dst;
 
    *dst = '\0';
@@ -1025,7 +1025,7 @@ static char *linein (const char *prompt) {
       }
       putp(fmtmk("%s%s%s", tg2(beg, Msg_row), Cap_clr_eol, buf));
       putp(tg2(beg+pos, Msg_row));
-   } while (kbd_ENTER != key && kbd_ESC != key);
+   } while (key && kbd_ENTER != key && kbd_ESC != key);
 
    return buf;
  #undef sqzSTR
@@ -1661,7 +1661,7 @@ static void fields_utility (void) {
          default:                 // keep gcc happy
             break;
       }
-   } while ('q' != key && kbd_ESC != key);
+   } while (key && 'q' != key && kbd_ESC != key);
    putp(Cap_curs_norm);
  #undef unSCRL
  #undef swapEM


Other related posts: