X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Flogin%2Flogind-dbus.c;h=c5f9cb393075bc5de5a0aec566bcc93cada19f1b;hp=fc8953155d56bcc2a41b2f48d62cd3d058e4c530;hb=236af516b866473c22f980b556a2d7535cef4d9b;hpb=151b9b9662a90455262ce575a8a8ae74bf4ff336 diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index fc8953155..c5f9cb393 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -594,6 +594,17 @@ static int method_create_session(sd_bus *bus, sd_bus_message *message, void *use if (!path) return -ENOMEM; + log_debug("Sending reply about an existing session: " + "id=%s object_path=%s uid=%u runtime_path=%s " + "session_fd=%d seat=%s vtnr=%u", + session->id, + path, + (uint32_t) session->user->uid, + session->user->runtime_path, + fifo_fd, + session->seat ? session->seat->id : "", + (uint32_t) session->vtnr); + return sd_bus_reply_method_return( message, "soshusub", session->id, @@ -1337,6 +1348,9 @@ static int execute_shutdown_or_sleep( m->action_job = c; 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); + return 0; } @@ -1477,6 +1491,8 @@ static int method_do_shutdown_or_sleep( action_multiple_sessions, interactive, error, method, m); if (r < 0) return r; + if (r == 0) + return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */ } if (blocked) { @@ -1484,6 +1500,8 @@ static int method_do_shutdown_or_sleep( action_ignore_inhibit, interactive, error, method, m); if (r < 0) return r; + if (r == 0) + return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */ } if (!multiple_sessions && !blocked) { @@ -1491,6 +1509,8 @@ static int method_do_shutdown_or_sleep( action, interactive, error, method, m); if (r < 0) return r; + if (r == 0) + return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */ } r = bus_manager_shutdown_or_sleep_now_or_later(m, unit_name, w, error);