From d9537fde9944a03f48054e0f4b6a9aea7d3c2a9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 11 Jun 2018 16:02:03 +0200 Subject: tree-wide: drop !! casts to booleans They are not needed, because anything that is non-zero is converted to true. C11: > 6.3.1.2: When any scalar value is converted to _Bool, the result is 0 if the > value compares equal to 0; otherwise, the result is 1. https://stackoverflow.com/questions/31551888/casting-int-to-bool-in-c-c --- src/login/logind-dbus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/login') diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 507368604..26a4ed889 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -245,9 +245,9 @@ static int property_get_preparing( assert(m); if (streq(property, "PreparingForShutdown")) - b = !!(m->action_what & INHIBIT_SHUTDOWN); + b = m->action_what & INHIBIT_SHUTDOWN; else - b = !!(m->action_what & INHIBIT_SLEEP); + b = m->action_what & INHIBIT_SLEEP; return sd_bus_message_append(reply, "b", b); } -- cgit v1.2.3