diff options
author | afrantzis <alexandros.frantzis@canonical.com> | 2017-04-05 11:32:55 +0300 |
---|---|---|
committer | Martin Pitt <martinpitt@users.noreply.github.com> | 2017-04-05 10:32:55 +0200 |
commit | 5e8273acac6af57d8c9cdec57388bab451a4cbc0 (patch) | |
tree | 897ea69afa836d4418c338a620d09ee412350455 /src/login | |
parent | 91dacd4451309e1f4b06fb2628447ddc8425d972 (diff) |
logind: Stopped inhibitions should be considered inactive (#5698)
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/logind-inhibit.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; |