OpenBSD: Fix SP.
This commit is contained in:
parent
5860cd7351
commit
95f81498c0
|
@ -257,8 +257,8 @@ _cpu_state_get(cpu_core_t **cores, int ncpu)
|
||||||
{
|
{
|
||||||
core = cores[0];
|
core = cores[0];
|
||||||
int cpu_time_mib[] = { CTL_KERN, KERN_CPTIME };
|
int cpu_time_mib[] = { CTL_KERN, KERN_CPTIME };
|
||||||
size = CPU_STATES * sizeof(unsigned long);
|
size = sizeof(struct cpustats);
|
||||||
if (sysctl(cpu_time_mib, 2, &cpu_times, &size, NULL, 0) < 0)
|
if (sysctl(cpu_time_mib, 2, &cpu_times[0], &size, NULL, 0) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
total = 0;
|
total = 0;
|
||||||
|
|
|
@ -326,8 +326,8 @@ _cpu_state_get(cpu_core_t **cores, int ncpu)
|
||||||
{
|
{
|
||||||
core = cores[0];
|
core = cores[0];
|
||||||
int cpu_time_mib[] = { CTL_KERN, KERN_CPTIME };
|
int cpu_time_mib[] = { CTL_KERN, KERN_CPTIME };
|
||||||
size = CPU_STATES * sizeof(unsigned long);
|
size = sizeof(struct cpustats);
|
||||||
if (sysctl(cpu_time_mib, 2, &cpu_times, &size, NULL, 0) < 0)
|
if (sysctl(cpu_time_mib, 2, &cpu_times[0], &size, NULL, 0) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
total = 0;
|
total = 0;
|
||||||
|
|
Loading…
Reference in New Issue