mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-06 12:58:22 +03:00
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:
parent
ddcbc87378
commit
398f7c881b
@ -1068,9 +1068,11 @@ static int bus_manager_can_shutdown_or_sleep(
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
if (r == 0) {
|
||||||
result = "na";
|
result = "na";
|
||||||
goto finish;
|
goto finish;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
r = have_multiple_sessions(connection, m, message, error);
|
r = have_multiple_sessions(connection, m, message, error);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user