summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/login/logind-dbus.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 26253eb619..c0dafa03ef 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -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";
}