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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user