From: Andy Wingo Date: Thu, 17 Mar 2016 08:21:53 +0000 (+0100) Subject: Clear pending action after resume from delayed sleep. X-Git-Tag: v226.4~3 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=aec42acfb7b53f130f7e79441cf7bdd90ff54fe1 Clear pending action after resume from delayed sleep. --- diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 210e75480..5162cdf87 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -1456,8 +1456,11 @@ static int execute_shutdown_or_sleep( if (r < 0) return r; - /* And we're back. */ - send_prepare_for(m, w, false); + if (w == INHIBIT_SLEEP) + /* And we're back. */ + send_prepare_for(m, w, false); + + m->action_what = 0; /* Make sure the lid switch is ignored for a while (?) */ manager_set_lid_switch_ignore(m, now(CLOCK_MONOTONIC) + m->holdoff_timeout_usec);