login: make hold-off timeout configurable · systemd/systemd@9d10cbe

@@ -1448,7 +1448,7 @@ static int execute_shutdown_or_sleep(

14481448

m->action_what = w;

1449144914501450

/* Make sure the lid switch is ignored for a while */

1451-

manager_set_lid_switch_ignore(m, now(CLOCK_MONOTONIC) + IGNORE_LID_SWITCH_SUSPEND_USEC);

1451+

manager_set_lid_switch_ignore(m, now(CLOCK_MONOTONIC) + m->holdoff_timeout_usec);

1452145214531453

return 0;

14541454

}

@@ -1979,6 +1979,7 @@ const sd_bus_vtable manager_vtable[] = {

19791979

SD_BUS_PROPERTY("HandleHibernateKey", "s", property_get_handle_action, offsetof(Manager, handle_hibernate_key), SD_BUS_VTABLE_PROPERTY_CONST),

19801980

SD_BUS_PROPERTY("HandleLidSwitch", "s", property_get_handle_action, offsetof(Manager, handle_lid_switch), SD_BUS_VTABLE_PROPERTY_CONST),

19811981

SD_BUS_PROPERTY("HandleLidSwitchDocked", "s", property_get_handle_action, offsetof(Manager, handle_lid_switch_docked), SD_BUS_VTABLE_PROPERTY_CONST),

1982+

SD_BUS_PROPERTY("HoldoffTimeoutUSec", "t", NULL, offsetof(Manager, holdoff_timeout_usec), SD_BUS_VTABLE_PROPERTY_CONST),

19821983

SD_BUS_PROPERTY("IdleAction", "s", property_get_handle_action, offsetof(Manager, idle_action), SD_BUS_VTABLE_PROPERTY_CONST),

19831984

SD_BUS_PROPERTY("IdleActionUSec", "t", NULL, offsetof(Manager, idle_action_usec), SD_BUS_VTABLE_PROPERTY_CONST),

19841985

SD_BUS_PROPERTY("PreparingForShutdown", "b", property_get_preparing, 0, 0),