From f92a4b93c57dd52d14205f444ae137ac223e4ff9 Mon Sep 17 00:00:00 2001 From: Hajimu UMEMOTO Date: Mon, 18 Jul 2005 20:15:31 +0000 Subject: [PATCH] Ignore EPERM from sysctl(3). It is returned when passive cooling is active. Reviewed by: njl --- usr.sbin/powerd/powerd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr.sbin/powerd/powerd.c b/usr.sbin/powerd/powerd.c index 13f515dc5e79..555218c831b8 100644 --- a/usr.sbin/powerd/powerd.c +++ b/usr.sbin/powerd/powerd.c @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -167,8 +168,10 @@ static int set_freq(int freq) { - if (sysctl(freq_mib, 4, NULL, NULL, &freq, sizeof(freq))) - return (-1); + if (sysctl(freq_mib, 4, NULL, NULL, &freq, sizeof(freq))) { + if (errno != EPERM) + return (-1); + } return (0); }