]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
logind: fix bool/int confusion for KillUserProcesses bus property 22543/head
authorLennart Poettering <lennart@poettering.net>
Wed, 16 Feb 2022 21:58:19 +0000 (22:58 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 16 Feb 2022 21:58:19 +0000 (22:58 +0100)
sd-bus for compat with old C expects "int" for booleans. Internally we
prefer to use C99 "bool" however. When pointing a pointer to it, we need
to handle the fact that they are typically differently sized, hence use
te right accessors for it.

src/login/logind-dbus.c

index 30bddb5402d7f799d6cd33c6c90d34997c829d7a..cd0dcea0e505fb23c59d87c4673d68a1577e83aa 100644 (file)
@@ -3283,7 +3283,7 @@ static const sd_bus_vtable manager_vtable[] = {
         SD_BUS_PROPERTY("NAutoVTs", "u", NULL, offsetof(Manager, n_autovts), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("KillOnlyUsers", "as", NULL, offsetof(Manager, kill_only_users), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("KillExcludeUsers", "as", NULL, offsetof(Manager, kill_exclude_users), SD_BUS_VTABLE_PROPERTY_CONST),
-        SD_BUS_PROPERTY("KillUserProcesses", "b", NULL, offsetof(Manager, kill_user_processes), SD_BUS_VTABLE_PROPERTY_CONST),
+        SD_BUS_PROPERTY("KillUserProcesses", "b", bus_property_get_bool, offsetof(Manager, kill_user_processes), SD_BUS_VTABLE_PROPERTY_CONST),
         SD_BUS_PROPERTY("RebootParameter", "s", property_get_reboot_parameter, 0, 0),
         SD_BUS_PROPERTY("RebootToFirmwareSetup", "b", property_get_reboot_to_firmware_setup, 0, 0),
         SD_BUS_PROPERTY("RebootToBootLoaderMenu", "t", property_get_reboot_to_boot_loader_menu, 0, 0),