Ignore:
Timestamp:
Nov 11, 2009, 4:28:06 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
0c11618
Parents:
00d6017
Message:

2009-11-11 Jennifer Averett <jennifer.averett@…>

PR 1471/cpukit

  • libmisc/cpuuse/cpuusagereport.c: Rework statement to ensure 64-bit multiplication is used to avoid overflow with intermediate value.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libmisc/cpuuse/cpuusagereport.c

    r00d6017 r00735ee  
    149149          );
    150150        #else
    151           ival = (total_units) ?
    152                    the_thread->cpu_time_used * 10000 / total_units : 0;
     151         if (total_units) {
     152            uint64_t ival_64;
     153
     154            ival_64 = the_thread->cpu_time_used;
     155            ival_64 *= 10000;
     156            ival = ival_64 / total_units;
     157          } else {
     158            ival = 0;
     159          }
     160
    153161          fval = ival % 1000;
    154162          ival /= 1000;
Note: See TracChangeset for help on using the changeset viewer.