fix: cpu.c was not coded correctly; some edge cases and using static-width integers

This commit is contained in:
2025-08-12 10:11:45 +02:00
parent bdccc05440
commit 82a33791de
3 changed files with 31 additions and 21 deletions

View File

@@ -1,3 +1,4 @@
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <sys/sysinfo.h>
@@ -10,10 +11,10 @@
static inline bool cpu_setter(uint32_t id, bool nstate, uint8_t opts) {
bool cstate = !nstate;
if (!(opts & OPT_SET_ALL))
cstate = getcpu(id);
cstate = cpu_getenabled(id);
if (cstate != nstate) {
setcpu(id, nstate);
cpu_setenabled(id, nstate);
return true;
}
return false;