Ignore EPERM from sysctl(3). It is returned when passive cooling

is active.

Reviewed by:	njl
This commit is contained in:
Hajimu UMEMOTO 2005-07-18 20:15:31 +00:00
parent e71de913d8
commit f92a4b93c5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=148139

View File

@ -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);
}