diff options
author | Benny Baumann <BenBE@geshi.org> | 2020-11-22 00:59:00 +0100 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2020-11-22 10:08:27 +0100 |
commit | 03f9a86918559525c816eb4c97df73bdef38bd38 (patch) | |
tree | 8c2229865f2d1520bea5359d63e586ca8b7c5d28 /linux/LinuxProcessList.c | |
parent | ddda739cb24ef2ea12ee556987ceeea71d322ffa (diff) |
Reduce scope of local variables
Diffstat (limited to 'linux/LinuxProcessList.c')
-rw-r--r-- | linux/LinuxProcessList.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index 4f40acad..7be54160 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -804,7 +804,6 @@ static int handleNetlinkMsg(struct nl_msg* nlmsg, void* linuxProcess) { struct nlattr* nlattr; struct taskstats stats; int rem; - unsigned long long int timeDelta; LinuxProcess* lp = (LinuxProcess*) linuxProcess; nlhdr = nlmsg_hdr(nlmsg); @@ -817,7 +816,7 @@ static int handleNetlinkMsg(struct nl_msg* nlmsg, void* linuxProcess) { memcpy(&stats, nla_data(nla_next(nla_data(nlattr), &rem)), sizeof(stats)); assert(lp->super.pid == (pid_t)stats.ac_pid); - timeDelta = stats.ac_etime * 1000 - lp->delay_read_time; + unsigned long long int timeDelta = stats.ac_etime * 1000 - lp->delay_read_time; #define BOUNDS(x) (isnan(x) ? 0.0 : ((x) > 100) ? 100.0 : (x)) #define DELTAPERC(x,y) BOUNDS((float) ((x) - (y)) / timeDelta * 100) lp->cpu_delay_percent = DELTAPERC(stats.cpu_delay_total, lp->cpu_delay_total); |