teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone
Blob Blame History Raw
From 1bcc1b6eba1505f816c91db504098b5b8509311e Mon Sep 17 00:00:00 2001
From: afrantzis <alexandros.frantzis@canonical.com>
Date: Wed, 5 Apr 2017 11:32:55 +0300
Subject: [PATCH] logind: Stopped inhibitions should be considered inactive
 (#5698)

(cherry picked from commit 5e8273acac6af57d8c9cdec57388bab451a4cbc0)
---
 src/login/logind-inhibit.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c
index 5ca42b1ca2..1e6f383738 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;