From: afrantzis Date: Wed, 5 Apr 2017 08:32:55 +0000 (+0300) Subject: logind: Stopped inhibitions should be considered inactive (#5698) X-Git-Tag: v234~332 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5e8273acac6af57d8c9cdec57388bab451a4cbc0;p=thirdparty%2Fsystemd.git logind: Stopped inhibitions should be considered inactive (#5698) --- diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c index 5ca42b1ca2a..1e6f3837382 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;