Skip to content
  • Takayuki Nagata's avatar
    libprocps: use float to calculate %use of slabtop · 23ba442c
    Takayuki Nagata authored
    
    
    In some environments, 100 * nr_active_objs is calculated at first,
    and the result of lower 32bits is divided by nr_objs. This occurs
    even in a 64-bit architecture. So nr_active_objes > 42949672, %use
    will be incorrect.
    
    This fix casts type of nr_active_objs to float to calculate
    correctly the %use in 32-bit/64-bit architectures.
    
    Signed-off-by: default avatarTakayuki Nagata <tnagata@redhat.com>
    23ba442c