[BACK]Return to cache.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / systat

Diff for /src/usr.bin/systat/cache.c between version 1.3 and 1.4

version 1.3, 2008/12/07 02:56:06 version 1.4, 2011/11/29 10:17:52
Line 118 
Line 118 
   
         cache_size--;          cache_size--;
   
         ent->id[0] = st->id[0];          ent->id = st->id;
         ent->id[1] = st->id[1];          ent->creatorid = st->creatorid;
         ent->bytes = COUNTER(st->bytes[0]) + COUNTER(st->bytes[1]);          ent->bytes = COUNTER(st->bytes[0]) + COUNTER(st->bytes[1]);
         ent->peak = 0;          ent->peak = 0;
         ent->rate = 0;          ent->rate = 0;
Line 139 
Line 139 
         if (cache_max == 0)          if (cache_max == 0)
                 return (NULL);                  return (NULL);
   
         ent.id[0] = st->id[0];          ent.id = st->id;
         ent.id[1] = st->id[1];          ent.creatorid = st->creatorid;
         old = RB_FIND(sc_tree, &sctree, &ent);          old = RB_FIND(sc_tree, &sctree, &ent);
   
         if (old == NULL) {          if (old == NULL) {
Line 189 
Line 189 
 static __inline int  static __inline int
 sc_cmp(struct sc_ent *a, struct sc_ent *b)  sc_cmp(struct sc_ent *a, struct sc_ent *b)
 {  {
         if (a->id[0] > b->id[0])          if (a->id > b->id)
                 return (1);                  return (1);
         if (a->id[0] < b->id[0])          if (a->id < b->id)
                 return (-1);                  return (-1);
         if (a->id[1] > b->id[1])          if (a->creatorid > b->creatorid)
                 return (1);                  return (1);
         if (a->id[1] < b->id[1])          if (a->creatorid < b->creatorid)
                 return (-1);                  return (-1);
         return (0);          return (0);
 }  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4