summaryrefslogtreecommitdiffstats
path: root/sys-utils/chcpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys-utils/chcpu.c')
-rw-r--r--sys-utils/chcpu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys-utils/chcpu.c b/sys-utils/chcpu.c
index 12e52d887..f32b7a6fc 100644
--- a/sys-utils/chcpu.c
+++ b/sys-utils/chcpu.c
@@ -81,7 +81,7 @@ static int cpu_enable(cpu_set_t *cpu_set, size_t setsize, int enable)
size_t fails = 0;
for (cpu = 0; cpu < setsize; cpu++) {
- if (!CPU_ISSET(cpu, cpu_set))
+ if (!CPU_ISSET_S(cpu, setsize, cpu_set))
continue;
if (!path_exist(_PATH_SYS_CPU "/cpu%d", cpu)) {
warnx(_("CPU %u does not exist"), cpu);
@@ -127,7 +127,7 @@ static int cpu_enable(cpu_set_t *cpu_set, size_t setsize, int enable)
} else {
printf(_("CPU %u disabled\n"), cpu);
if (onlinecpus)
- CPU_CLR(cpu, onlinecpus);
+ CPU_CLR_S(cpu, setsize, onlinecpus);
}
}
}
@@ -173,7 +173,7 @@ static int cpu_configure(cpu_set_t *cpu_set, size_t setsize, int configure)
size_t fails = 0;
for (cpu = 0; cpu < setsize; cpu++) {
- if (!CPU_ISSET(cpu, cpu_set))
+ if (!CPU_ISSET_S(cpu, setsize, cpu_set))
continue;
if (!path_exist(_PATH_SYS_CPU "/cpu%d", cpu)) {
warnx(_("CPU %u does not exist"), cpu);