logind: fix boolean comparison

We cannot compare a boolean with a bit mask. This worked only by
accident, since MANAGER_IS_INHIBITED_CHECK_DELAY happened to be 1. But
we need to do this properly.

Fixes: #35565
This commit is contained in:
Lennart Poettering
2025-06-20 10:18:46 +02:00
parent c4ad8365d5
commit 897c4ff111
+2 -2
View File
@@ -421,10 +421,10 @@ bool manager_is_inhibited(
if (!(i->what & w))
continue;
if ((flags & MANAGER_IS_INHIBITED_CHECK_DELAY) != (i->mode == INHIBIT_DELAY))
if (FLAGS_SET(flags, MANAGER_IS_INHIBITED_CHECK_DELAY) != (i->mode == INHIBIT_DELAY))
continue;
if ((flags & MANAGER_IS_INHIBITED_IGNORE_INACTIVE) &&
if (FLAGS_SET(flags, MANAGER_IS_INHIBITED_IGNORE_INACTIVE) &&
pidref_is_active_session(m, &i->pid) <= 0)
continue;