]> git.ipfire.org Git - thirdparty/systemd.git/commit
logind: fix getting property OnExternalPower via D-Bus 24976/head
authorMichael Biebl <biebl@debian.org>
Wed, 12 Oct 2022 09:07:57 +0000 (11:07 +0200)
committerMichael Biebl <biebl@debian.org>
Wed, 12 Oct 2022 09:15:27 +0000 (11:15 +0200)
commit63168cb517a556b2f4f175b365f5a4b4c7e85150
tree89954a4acf872c990611728de91d6a7a4db821d2
parent9d4cfc7579cd9a4673ab5433bb7babc821f65627
logind: fix getting property OnExternalPower via D-Bus

The BUS_DEFINE_PROPERTY_GET_GLOBAL macro requires a value as third
argument, so we need to call manager_is_on_external_power(). Otherwise
the function pointer is interpreted as a boolean and always returns
true:

```
$ busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager OnExternalPower
b true
$ /lib/systemd/systemd-ac-power  --verbose
no
```

Thanks: Helmut Grohne <helmut@subdivi.de>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021644
src/login/logind-dbus.c