X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Flogin%2Flogind-dbus.c;h=a3d49efbdd45cced85703cbbc19e818c79c3b530;hp=5d61edbd463fc6fcfb067f5b27b1d9f5ee26aefe;hb=ad8780c96999c99f5aefb00193f2e3d68b1db217;hpb=c529695e7a30b300fdaa61ace4a8a4ed0e94ad1c diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 5d61edbd4..a3d49efbd 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -24,7 +24,6 @@ #include #include -#include "sd-id128.h" #include "sd-messages.h" #include "strv.h" #include "mkdir.h" @@ -32,10 +31,7 @@ #include "special.h" #include "sleep-config.h" #include "fileio-label.h" -#include "label.h" -#include "utf8.h" #include "unit-name.h" -#include "virt.h" #include "audit.h" #include "bus-util.h" #include "bus-error.h" @@ -831,7 +827,9 @@ static int method_release_session(sd_bus *bus, sd_bus_message *message, void *us if (r < 0) return r; - session_release(session); + r = session_release(session); + if (r < 0) + return r; return sd_bus_reply_method_return(message, NULL); } @@ -1452,7 +1450,7 @@ static int execute_shutdown_or_sleep( m->action_what = w; /* Make sure the lid switch is ignored for a while */ - manager_set_lid_switch_ignore(m, now(CLOCK_MONOTONIC) + IGNORE_LID_SWITCH_SUSPEND_USEC); + manager_set_lid_switch_ignore(m, now(CLOCK_MONOTONIC) + m->holdoff_timeout_usec); return 0; } @@ -1983,6 +1981,7 @@ const sd_bus_vtable manager_vtable[] = { SD_BUS_PROPERTY("HandleHibernateKey", "s", property_get_handle_action, offsetof(Manager, handle_hibernate_key), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("HandleLidSwitch", "s", property_get_handle_action, offsetof(Manager, handle_lid_switch), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("HandleLidSwitchDocked", "s", property_get_handle_action, offsetof(Manager, handle_lid_switch_docked), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("HoldoffTimeoutUSec", "t", NULL, offsetof(Manager, holdoff_timeout_usec), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("IdleAction", "s", property_get_handle_action, offsetof(Manager, idle_action), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("IdleActionUSec", "t", NULL, offsetof(Manager, idle_action_usec), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("PreparingForShutdown", "b", property_get_preparing, 0, 0),