From: afrantzis Date: Wed, 5 Apr 2017 08:32:55 +0000 (+0300) Subject: logind: Stopped inhibitions should be considered inactive (#5698) X-Git-Tag: chiark/234.4-1+devuan1.1+iwj1~168 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=a72a563ceb1d18c605b9945716d014e39839e6e7;p=elogind.git logind: Stopped inhibitions should be considered inactive (#5698) --- 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;