From: Lennart Poettering Date: Thu, 19 Jun 2025 16:27:06 +0000 (+0200) Subject: logind: fix boolean comparison X-Git-Tag: v258-rc1~282^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F37907%2Fhead;p=thirdparty%2Fsystemd.git 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 --- diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c index 4614609e8a0..2ef15588f28 100644 --- a/src/login/logind-inhibit.c +++ b/src/login/logind-inhibit.c @@ -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;