chiark / gitweb /
logind: Stopped inhibitions should be considered inactive (#5698)
authorafrantzis <alexandros.frantzis@canonical.com>
Wed, 5 Apr 2017 08:32:55 +0000 (11:32 +0300)
committerSven Eden <yamakuzure@gmx.net>
Tue, 25 Jul 2017 07:46:51 +0000 (09:46 +0200)
src/login/logind-inhibit.c

index 5ca42b1ca2ae2c4d14cc4f73f23e25d181b3112e..1e6f3837382fe163fed58bbeda901abdda364d91 100644 (file)
@@ -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;