logind: interpret the can_sleep return value properly

can_sleep() returns a boolean, so a return value > 0 does not
mean 'na'.
This commit is contained in:
Matthias Clasen
2012-06-01 15:58:21 +02:00
committed by Lennart Poettering
parent ddcbc87378
commit 398f7c881b
+4 -2
View File
@@ -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);