1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-11 09:18:07 +03:00

Merge pull request #22543 from poettering/logind-fix-bus-bool-prop

logind: fix some sd-bus int/bool/unsigned mixups
This commit is contained in:
Yu Watanabe 2022-02-17 16:44:51 +09:00 committed by GitHub
commit 30778ead7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -2058,10 +2058,10 @@ static int update_schedule_file(Manager *m) {
fprintf(f, fprintf(f,
"USEC="USEC_FMT"\n" "USEC="USEC_FMT"\n"
"WARN_WALL=%i\n" "WARN_WALL=%s\n"
"MODE=%s\n", "MODE=%s\n",
m->scheduled_shutdown_timeout, m->scheduled_shutdown_timeout,
m->enable_wall_messages, one_zero(m->enable_wall_messages),
handle_action_to_string(m->scheduled_shutdown_type->handle)); handle_action_to_string(m->scheduled_shutdown_type->handle));
if (!isempty(m->wall_message)) { if (!isempty(m->wall_message)) {
@ -3116,7 +3116,7 @@ static int method_set_wall_message(
int r; int r;
Manager *m = userdata; Manager *m = userdata;
char *wall_message; char *wall_message;
unsigned enable_wall_messages; int enable_wall_messages;
assert(message); assert(message);
assert(m); assert(m);
@ -3277,13 +3277,13 @@ static int method_inhibit(sd_bus_message *message, void *userdata, sd_bus_error
static const sd_bus_vtable manager_vtable[] = { static const sd_bus_vtable manager_vtable[] = {
SD_BUS_VTABLE_START(0), SD_BUS_VTABLE_START(0),
SD_BUS_WRITABLE_PROPERTY("EnableWallMessages", "b", NULL, NULL, offsetof(Manager, enable_wall_messages), 0), SD_BUS_WRITABLE_PROPERTY("EnableWallMessages", "b", bus_property_get_bool, bus_property_set_bool, offsetof(Manager, enable_wall_messages), 0),
SD_BUS_WRITABLE_PROPERTY("WallMessage", "s", NULL, NULL, offsetof(Manager, wall_message), 0), SD_BUS_WRITABLE_PROPERTY("WallMessage", "s", NULL, NULL, offsetof(Manager, wall_message), 0),
SD_BUS_PROPERTY("NAutoVTs", "u", NULL, offsetof(Manager, n_autovts), SD_BUS_VTABLE_PROPERTY_CONST), 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("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("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("RebootParameter", "s", property_get_reboot_parameter, 0, 0),
SD_BUS_PROPERTY("RebootToFirmwareSetup", "b", property_get_reboot_to_firmware_setup, 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), SD_BUS_PROPERTY("RebootToBootLoaderMenu", "t", property_get_reboot_to_boot_loader_menu, 0, 0),

View File

@ -87,7 +87,7 @@ struct Manager {
bool unlink_nologin; bool unlink_nologin;
char *wall_message; char *wall_message;
unsigned enable_wall_messages; bool enable_wall_messages;
sd_event_source *wall_message_timeout_source; sd_event_source *wall_message_timeout_source;
bool shutdown_dry_run; bool shutdown_dry_run;