From 398f7c881b90d2ca4edafcb60dba3822eb9f73eb Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 31 May 2012 21:50:23 -0400 Subject: [PATCH] logind: interpret the can_sleep return value properly can_sleep() returns a boolean, so a return value > 0 does not mean 'na'. --- src/login/logind-dbus.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 6175d57d..f4b232b9 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -1068,8 +1068,10 @@ static int bus_manager_can_shutdown_or_sleep( if (r < 0) return r; - result = "na"; - goto finish; + if (r == 0) { + result = "na"; + goto finish; + } } r = have_multiple_sessions(connection, m, message, error); -- 2.39.5