freebsd: Fix lid detection on FreeBSD

UPower sets property LidIsPresent to true only if hw.acpi.lid_switch_state
is different from "NONE", "NONE" being the default value for FreeBSD.
Thus, the property is always false on default configurations.

Force UPower not to care about the value of the sysctl, making it check
only for its existence.

See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=175531

https://bugs.freedesktop.org/show_bug.cgi?id=101828
This commit is contained in:
Alberto Villa 2017-07-18 09:49:06 +00:00 committed by Bastien Nocera
parent 4753a8bc5a
commit 71ba27a7ea

View file

@ -226,7 +226,7 @@ up_backend_lid_coldplug (UpBackend *backend)
gchar *lid_state;
lid_state = up_get_string_sysctl (NULL, "hw.acpi.lid_switch_state");
if (lid_state && strcmp (lid_state, "NONE")) {
if (lid_state) {
up_daemon_set_lid_is_present (backend->priv->daemon, TRUE);
}
g_free (lid_state);