From 7b3b36834418303a28dd6ee1d7ac679df1a73e4c Mon Sep 17 00:00:00 2001 From: Robert Millan Date: Mon, 9 Apr 2012 20:59:14 +0000 Subject: [PATCH] Improve error reporting when no cpufreq(4) support is available. Reviewed by: njl, acpi --- usr.sbin/powerd/powerd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/powerd/powerd.c b/usr.sbin/powerd/powerd.c index 8db875bdc9a6..254c237b83ff 100644 --- a/usr.sbin/powerd/powerd.c +++ b/usr.sbin/powerd/powerd.c @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef __i386__ @@ -536,7 +537,7 @@ main(int argc, char * argv[]) err(1, "lookup kern.cp_times"); len = 4; if (sysctlnametomib("dev.cpu.0.freq", freq_mib, &len)) - err(1, "lookup freq"); + err(EX_UNAVAILABLE, "no cpufreq(4) support -- aborting"); len = 4; if (sysctlnametomib("dev.cpu.0.freq_levels", levels_mib, &len)) err(1, "lookup freq_levels");