diff options
author | ume <ume@FreeBSD.org> | 2005-07-18 20:15:31 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2005-07-18 20:15:31 +0000 |
commit | ab226d701074fc8390084932b99f253066737b53 (patch) | |
tree | 9b98c452133d40de2ec2212c4e55ba5ecb5cfebf | |
parent | 240856811f51664a8d22c1cb76d3a300c48925a4 (diff) | |
download | FreeBSD-src-ab226d701074fc8390084932b99f253066737b53.zip FreeBSD-src-ab226d701074fc8390084932b99f253066737b53.tar.gz |
Ignore EPERM from sysctl(3). It is returned when passive cooling
is active.
Reviewed by: njl
-rw-r--r-- | usr.sbin/powerd/powerd.c | 7 |
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); } |