Battery: fixes for FreeBSD
This commit is contained in:
parent
7ea2452ae4
commit
7384fd8270
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue