1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-25 23:21:33 +03:00

logind: fix determination of CanHibernate() and other calls

As suggest here:

https://github.com/systemd/systemd/issues/10250#issuecomment-426788301

Fixes: #10250

(This suggested patch has been converted into a proper commit by me,
Lennart, with attribution to the original author, @henryptung)
This commit is contained in:
Henry Tung 2018-10-23 14:09:13 +02:00 committed by Lennart Poettering
parent c78e6f9e7b
commit 0c093a62ef

View File

@ -2267,11 +2267,13 @@ static int method_can_shutdown_or_sleep(
if (r < 0)
return r;
if (r > 0 && !result)
result = "yes";
else if (challenge && (!result || streq(result, "yes")))
result = "challenge";
else
if (r > 0) {
if (!result)
result = "yes";
} else if (challenge) {
if (!result || streq(result, "yes"))
result = "challenge";
} else
result = "no";
}