[SSI] openssi/procps top.c, 1.1.15.1, 1.1.15.2 top.h, 1.1.15.1, 1.1.15.2

Roger Tsang <[email protected]> Sun, 08 Aug 2010 03:34:01 +0000
Newsgroups gmane.linux.cluster.ssic.cvs
Message-ID <[email protected]>
Update of /cvsroot/ssic-linux/openssi/procps
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv9307

Modified Files:
      Tag: CENTOS
	top.c top.h 
Log Message:
Import from procps-3.2.3-8.17.el4_8.2 for CentOS 4


Index: top.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/procps/Attic/top.c,v
retrieving revision 1.1.15.1
retrieving revision 1.1.15.2
diff -u -d -r1.1.15.1 -r1.1.15.2
--- top.c	4 Jul 2010 21:36:47 -0000	1.1.15.1
+++ top.c	8 Aug 2010 03:33:58 -0000	1.1.15.2
@@ -1636,7 +1636,7 @@
    if(Rc.mode_irixps && smp_num_cpus>1){
       // good for 100 CPUs per process
       pcpu_max_value = 9999.0;
-      Fieldstab[P_CPU].fmts = " %4.0f";
+      Fieldstab[P_CPU].fmts = " %4.1f";
    }
 }
 
@@ -1648,67 +1648,57 @@
 // Due to Rik blindly accepting damem's broken patches, procps-2.0.1x
 // has 3 ("three"!!!) instances of "#C", "LC", or "CPU". Fix that too.
 static void confighlp (char *fields) {
-   unsigned upper[128];
-   unsigned lower[128];
-   static char all_fields[P_FLG + 1];
+   unsigned upper[P_FLG + 1];
+   unsigned lower[P_FLG + 1];
    char c;
    int i;
    char *cp;
 
-   memset(upper, '\0', sizeof upper);
-   memset(lower, '\0', sizeof lower);
+   memset(upper, 0, sizeof upper);
+   memset(lower, 0, sizeof lower);
 
-   for (i = P_PID; i <= P_FLG; i++) {
-      all_fields[i] = Fieldstab[i].keys[FT_NEW_fmt + 1];
-   }
    cp = fields;
    while (c = *cp) {
       if ((i = ft_get_idx(FT_NEW_fmt, c)) > -1) {
          if (c == Fieldstab[i].keys[FT_NEW_fmt]) {
-            all_fields[i] = c;
+            lower[i]++;
          }
+         else {
+            upper[i]++;
+         }	 
+         ++cp;
+      }
+      else {
+         /* unknown character */
+         memmove(cp, cp+1, strlen(cp));
       }
-      cp++;
-   }
-
-   memcpy(fields, all_fields, sizeof(all_fields));
-#if 0
-   cp = fields;
-   for (;;) {
-      c = *cp++;
-      if (!c) break;
-      if(isupper(c)) upper[c&0x1f]++;
-      else           lower[c&0x1f]++;
    }
 
-   c = 'a';
-   while (c <= 'z') {
-      if (upper[c&0x1f] && lower[c&0x1f]) {
-         lower[c&0x1f] = 0;             // got both, so wipe out unseen column
+   for (i = P_PID; i <= P_FLG; i++) {
+      if (upper[i] && lower[i]) {
+         lower[i] = 0;             // got both, so wipe out unseen column
          for (;;) {
-            cp = strchr(fields, c);
+            cp = strchr(fields, Fieldstab[i].keys[FT_NEW_fmt]);
             if (cp) memmove(cp, cp+1, strlen(cp));
             else break;
          }
       }
-      while (lower[c&0x1f] > 1) {               // got too many a..z
-         lower[c&0x1f]--;
-         cp = strchr(fields, c);
+      while (lower[i] > 1) {               // got too many a..z
+         lower[i]--;
+         cp = strchr(fields, Fieldstab[i].keys[FT_NEW_fmt]);
          memmove(cp, cp+1, strlen(cp));
       }
-      while (upper[c&0x1f] > 1) {               // got too many A..Z
-         upper[c&0x1f]--;
-         cp = strchr(fields, toupper(c));
+      while (upper[i] > 1) {               // got too many A..Z
+         upper[i]--;
+         cp = strchr(fields, Fieldstab[i].keys[FT_NEW_fmt + 1]);
          memmove(cp, cp+1, strlen(cp));
       }
-      if (!upper[c&0x1f] && !lower[c&0x1f]) {   // both missing
-         lower[c&0x1f]++;
+      if (!upper[i] && !lower[i]) {   // both missing
+         lower[i]++;
          memmove(fields+1, fields, strlen(fields)+1);
-         fields[0] = c;
+         fields[0] = Fieldstab[i].keys[FT_NEW_fmt];
       }
-      c++;
    }
-#endif
 }
 
 
@@ -2073,6 +2063,7 @@
       *p = ft->keys[FT_NEW_fmt];
    Curwin->rc.sortindx = x;
    putp(Cap_curs_norm);
+   putp(Cap_clr_scr);
 }
 
 
@@ -2098,6 +2089,7 @@
          *p = f->keys[FT_NEW_fmt];
    }
    putp(Cap_curs_norm);
+   putp(Cap_clr_scr);
 }
 
 /*######  Windows/Field Groups support  #################################*/

Index: top.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/procps/Attic/top.h,v
retrieving revision 1.1.15.1
retrieving revision 1.1.15.2
diff -u -d -r1.1.15.1 -r1.1.15.2
--- top.h	4 Jul 2010 21:36:46 -0000	1.1.15.1
+++ top.h	8 Aug 2010 03:33:58 -0000	1.1.15.2
@@ -356,7 +356,7 @@
 #define RCF_DEPRECATED  "Id:a, "
 
 // The default fields displayed and their order,
-#define DEF_FIELDS  "AEHIOQTWKNMbcdfgjplrsuvyzX"
+#define DEF_FIELDS  "AEHIOQTWKNMbcdfgjplrsuvyzX12"
 // Pre-configured field groupss
 #define JOB_FIELDS  "ABcefgjlrstuvyzMKNHIWOPQDX"
 #define MEM_FIELDS  "ANOPQRSTUVbcdefgjlmyzWHIKX"


------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev