From 897c4ff11153eb1e640fce52e93d72d5939a2789 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 19 Jun 2025 18:27:06 +0200 Subject: [PATCH] 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 --- src/login/logind-inhibit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.47.3