]> granicus.if.org Git - procps-ng/commitdiff
library: remove one needless function call, <STAT> api
authorJim Warner <james.warner@comcast.net>
Fri, 11 Jan 2019 06:00:00 +0000 (00:00 -0600)
committerCraig Small <csmall@enc.com.au>
Tue, 22 Jan 2019 11:49:24 +0000 (22:49 +1100)
This small change is an outgrowth of the research into
the bug represented by that merge request shown below.

With the master branch, a real buglet was subsequently
addressed. In this newlib branch, no bug existed since
the <stat> API relies solely on just cpus reflected in
(and parsed from) the kernel's /proc/stat pseudo file.

[ since that procps_stat_new() priming read about to ]
[ be performed will value info->cpus.total, there is ]
[ no need to separately invoke a procps_cpu_count(). ]

Reference(s):
https://gitlab.com/procps-ng/procps/merge_requests/82

Signed-off-by: Jim Warner <james.warner@comcast.net>
proc/stat.c

index 524dfe074a522b76429d72f6c037281634027a26..a8f8e24bfd60a8d3935e7b4a11358b6c29afa8cf 100644 (file)
@@ -877,7 +877,6 @@ PROCPS_EXPORT int procps_stat_new (
 
     p->results.cpus = &p->cpus.result;
     p->results.nodes = &p->nodes.result;
-    p->cpus.total = procps_cpu_count();
 
     // these 3 are for reap, sharing a single set of items
     p->cpu_summary.items = p->cpus.fetch.items = p->nodes.fetch.items = &p->reap_items;