summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-05-21 18:26:48 +0200
committerLennart Poettering <lennart@poettering.net>2021-05-22 11:00:00 +0200
commit61dc84817efe460269d23043456cb1b51527f504 (patch)
treedd65e1c32541bcae4627b31234a5623ec984840f
parentsleep: use SleepOperation enum everywhere and drop sleep_settings() (diff)
downloadsystemd-61dc84817efe460269d23043456cb1b51527f504.tar.xz
systemd-61dc84817efe460269d23043456cb1b51527f504.zip
sleep: can_sleep_state() + can_sleep_disk() don#t return plain booleans
-rw-r--r--src/shared/sleep-config.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/sleep-config.c b/src/shared/sleep-config.c
index 7277a55635..b02dd5467d 100644
--- a/src/shared/sleep-config.c
+++ b/src/shared/sleep-config.c
@@ -634,8 +634,8 @@ static int can_sleep_internal(
if (operation == SLEEP_SUSPEND_THEN_HIBERNATE)
return can_s2h(sleep_config);
- if (!can_sleep_state(sleep_config->states[operation]) ||
- !can_sleep_disk(sleep_config->modes[operation]))
+ if (can_sleep_state(sleep_config->states[operation]) <= 0 ||
+ can_sleep_disk(sleep_config->modes[operation]) <= 0)
return false;
if (operation == SLEEP_SUSPEND)