summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2012-05-31 21:50:23 -0400
committerLennart Poettering <lennart@poettering.net>2012-06-01 15:58:21 +0200
commit398f7c881b90d2ca4edafcb60dba3822eb9f73eb (patch)
treeed9c043d6629a68c1d206d33c04565b2ce24e89c /src
parentddcbc8737873ca1904562d7d3ca3de9946e2f889 (diff)
logind: interpret the can_sleep return value properly
can_sleep() returns a boolean, so a return value > 0 does not mean 'na'.
Diffstat (limited to 'src')
-rw-r--r--src/login/logind-dbus.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 6175d57d8c..f4b232b9ae 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);