diff options
Diffstat (limited to 'components/cpu.c')
-rw-r--r-- | components/cpu.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/components/cpu.c b/components/cpu.c index 10d25c0..d0d03c7 100644 --- a/components/cpu.c +++ b/components/cpu.c @@ -118,8 +118,7 @@ size = sizeof(freq); /* in MHz */ - if (sysctlbyname("hw.clockrate", &freq, &size, NULL, 0) == -1 - || !size) { + if (sysctlbyname("hw.clockrate", &freq, &size, NULL, 0) < 0 || !size) { warn("sysctlbyname 'hw.clockrate':"); return NULL; } @@ -136,8 +135,7 @@ size = sizeof(a); memcpy(b, a, sizeof(b)); - if (sysctlbyname("kern.cp_time", &a, &size, NULL, 0) == -1 - || !size) { + if (sysctlbyname("kern.cp_time", &a, &size, NULL, 0) < 0 || !size) { warn("sysctlbyname 'kern.cp_time':"); return NULL; } |