|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
From 1bcc1b6eba1505f816c91db504098b5b8509311e Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
From: afrantzis <alexandros.frantzis@canonical.com>
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
Date: Wed, 5 Apr 2017 11:32:55 +0300
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
Subject: [PATCH] logind: Stopped inhibitions should be considered inactive
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
(#5698)
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
(cherry picked from commit 5e8273acac6af57d8c9cdec57388bab451a4cbc0)
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
src/login/logind-inhibit.c | 5 ++++-
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
index 5ca42b1ca2..1e6f383738 100644
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
--- a/src/login/logind-inhibit.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+++ b/src/login/logind-inhibit.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
@@ -347,7 +347,7 @@ InhibitWhat manager_inhibit_what(Manager *m, InhibitMode mm) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
assert(m);
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
HASHMAP_FOREACH(i, m->inhibitors, j)
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
- if (i->mode == mm)
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+ if (i->mode == mm && i->started)
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
what |= i->what;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
return what;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
@@ -388,6 +388,9 @@ bool manager_is_inhibited(
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
assert(w > 0 && w < _INHIBIT_WHAT_MAX);
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
HASHMAP_FOREACH(i, m->inhibitors, j) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+ if (!i->started)
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+ continue;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
if (!(i->what & w))
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
continue;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|