From: Matthias Clasen Date: Fri, 1 Jun 2012 01:50:23 +0000 (-0400) Subject: logind: interpret the can_sleep return value properly X-Git-Tag: v185~22 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=398f7c881b90d2ca4edafcb60dba3822eb9f73eb;p=systemd logind: interpret the can_sleep return value properly can_sleep() returns a boolean, so a return value > 0 does not mean 'na'. --- 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);