]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemd-sleep: (bug) honor s2h and hybrid_sleep disable settings 12619/head
authorZach Smith <z@zxmth.us>
Thu, 30 May 2019 13:06:51 +0000 (06:06 -0700)
committerZach Smith <z@zxmth.us>
Thu, 30 May 2019 13:08:02 +0000 (06:08 -0700)
src/shared/sleep-config.c

index 32a22eebd2db1890049166095cb73f25267d50c0..4026655809ae44524ef6223fe6f4343f4b8641df 100644 (file)
@@ -66,10 +66,10 @@ int parse_sleep_config(SleepConfig **ret_sleep_config) {
         /* use default values unless set */
         sc->allow_suspend = allow_suspend != 0;
         sc->allow_hibernate = allow_hibernate != 0;
-        sc->allow_hybrid_sleep = allow_hybrid_sleep > 0
-                || (allow_suspend != 0 && allow_hibernate != 0);
-        sc->allow_s2h = allow_s2h > 0
-                || (allow_suspend != 0 && allow_hibernate != 0);
+        sc->allow_hybrid_sleep = allow_hybrid_sleep >= 0 ? allow_hybrid_sleep
+                : (allow_suspend != 0 && allow_hibernate != 0);
+        sc->allow_s2h = allow_s2h >= 0 ? allow_s2h
+                : (allow_suspend != 0 && allow_hibernate != 0);
 
         if (!sc->suspend_states)
                 sc->suspend_states = strv_new("mem", "standby", "freeze");