Battery: fixes for FreeBSD

This commit is contained in:
o9000 2015-05-03 08:52:39 +02:00
parent 7ea2452ae4
commit 7384fd8270

View file

@ -188,7 +188,11 @@ void init_battery()
battery_found = 1;
}
#elif defined(__FreeBSD__)
// Nothing to do
int sysctl_out = 0;
size_t len = sizeof(sysctl_out);
battery_found = (sysctlbyname("hw.acpi.battery.state", &sysctl_out, &len, NULL, 0) == 0) ||
(sysctlbyname("hw.acpi.battery.time", &sysctl_out, &len, NULL, 0) == 0) ||
(sysctlbyname("hw.acpi.battery.life", &sysctl_out, &len, NULL, 0) == 0);
#else // Linux
GDir *directory = 0;
GError *error = NULL;