diff options
author | Sven Eden <yamakuzure@gmx.net> | 2017-06-15 16:51:11 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-06-16 10:13:02 +0200 |
commit | a0b00cabbb5943c0b777eb22f7d20e8b90b290b0 (patch) | |
tree | f25a7901686e2afbbe6280c67c642b02d99d32fa | |
parent | d51f91fd83c0d96a667b300b14248f1123702ba0 (diff) |
Prep v229.6: Send wakeup call to suspended processes.
Somewhere in the update stream from 227.x to 228.x the sending of the
wakeup signal to sleeping processes got lost.
Re-add the sending of the wakeup signal.
Fixes issue 17
( https://github.com/elogind/elogind/issues/17 )
-rw-r--r-- | src/login/logind-dbus.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index c2628ad7c..cb67c668f 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -53,6 +53,10 @@ /// Additional includes needed by elogind #include "update-utmp.h" +#if 1 /// elogind needs this prototype +static int send_prepare_for(Manager *m, InhibitWhat w, bool _active); +#endif // 1 + int manager_get_session_from_creds(Manager *m, sd_bus_message *message, const char *name, sd_bus_error *error, Session **ret) { _cleanup_(sd_bus_creds_unrefp) sd_bus_creds *creds = NULL; Session *session; @@ -1623,9 +1627,17 @@ static int execute_shutdown_or_sleep( /* no more pending actions, whether this failed or not */ m->pending_action = HANDLE_IGNORE; - m->action_what = 0; if (r < 0) return r; + + /* As elogind can not rely on a systemd manager to call all + * sleeping processes to wake up, we have to tell them all + * by ourselves. */ + if (w == INHIBIT_SLEEP) { + send_prepare_for(m, w, false); + m->action_what = 0; + } else + m->action_what = w; #endif // 0 /* Make sure the lid switch is ignored for a while */ |