diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index c465456e24..5777d9dff1 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -428,6 +428,19 @@ bool HOST_INFO::host_is_running_on_batteries() { return true; } + return false; +#elif defined(__FreeBSD__) + int ac; + size_t len = sizeof(ac); + + if (sysctlbyname("hw.acpi.acline", &ac, &len, NULL, 0) != -1) { + if (ac) + // AC present + return false; + else + return true; + } + return false; #else return false;