summaryrefslogtreecommitdiffstats
path: root/usr.sbin/powerd
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2005-07-18 20:15:31 +0000
committerume <ume@FreeBSD.org>2005-07-18 20:15:31 +0000
commitab226d701074fc8390084932b99f253066737b53 (patch)
tree9b98c452133d40de2ec2212c4e55ba5ecb5cfebf /usr.sbin/powerd
parent240856811f51664a8d22c1cb76d3a300c48925a4 (diff)
downloadFreeBSD-src-ab226d701074fc8390084932b99f253066737b53.zip
FreeBSD-src-ab226d701074fc8390084932b99f253066737b53.tar.gz
Ignore EPERM from sysctl(3). It is returned when passive cooling
is active. Reviewed by: njl
Diffstat (limited to 'usr.sbin/powerd')
-rw-r--r--usr.sbin/powerd/powerd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/powerd/powerd.c b/usr.sbin/powerd/powerd.c
index 13f515d..555218c 100644
--- a/usr.sbin/powerd/powerd.c
+++ b/usr.sbin/powerd/powerd.c
@@ -29,6 +29,7 @@
__FBSDID("$FreeBSD$");
#include <err.h>
+#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
@@ -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);
}
OpenPOWER on IntegriCloud