diff options
author | afrantzis <alexandros.frantzis@canonical.com> | 2017-04-05 11:32:55 +0300 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-07-25 09:46:51 +0200 |
commit | a72a563ceb1d18c605b9945716d014e39839e6e7 (patch) | |
tree | be7005fd4037078e9a9f387d8d34fa2c2a511168 /src | |
parent | adecb8a9ad4f651e1b911ce00daa609a4774a931 (diff) |
logind: Stopped inhibitions should be considered inactive (#5698)
Diffstat (limited to 'src')
-rw-r--r-- | src/login/logind-inhibit.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c index 5ca42b1ca..1e6f38373 100644 --- a/src/login/logind-inhibit.c +++ b/src/login/logind-inhibit.c @@ -347,7 +347,7 @@ InhibitWhat manager_inhibit_what(Manager *m, InhibitMode mm) { assert(m); HASHMAP_FOREACH(i, m->inhibitors, j) - if (i->mode == mm) + if (i->mode == mm && i->started) what |= i->what; return what; @@ -388,6 +388,9 @@ bool manager_is_inhibited( assert(w > 0 && w < _INHIBIT_WHAT_MAX); HASHMAP_FOREACH(i, m->inhibitors, j) { + if (!i->started) + continue; + if (!(i->what & w)) continue; |