Ticket #1471: Overflow2Patch.txt

File Overflow2Patch.txt, 1.0 KB (added by Jennifer Averett, on 11/11/09 at 15:09:39)

4.9 patch to resolve overflow problem

Line 
1Index: cpuusagereport.c
2===================================================================
3RCS file: /shorad/Repository/rtems-4.9-cvs/cpukit/libmisc/cpuuse/cpuusagereport.c,v
4retrieving revision 1.13
5diff -c -r1.13 cpuusagereport.c
6*** cpuusagereport.c    11 Nov 2009 14:07:06 -0000      1.13
7--- cpuusagereport.c    11 Nov 2009 15:29:48 -0000
8***************
9*** 141,148 ****
10              ival, fval
11            );
12          #else
13!           ival = (total_units) ?
14!                    the_thread->cpu_time_used * 10000 / total_units : 0;
15            fval = ival % 100;
16            ival /= 100;
17            (*print)( context,
18--- 141,157 ----
19              ival, fval
20            );
21          #else
22!           if (total_units) {
23!             uint64_t ival_64;
24!
25!             ival_64 = the_thread->cpu_time_used;
26!             ival_64 *= 10000;
27!             ival = ival_64/total_units;
28!
29!           } else {
30!             ival = 0;
31!           }
32!
33            fval = ival % 100;
34            ival /= 100;
35            (*print)( context,