From: Zach Smith Date: Thu, 30 May 2019 13:06:51 +0000 (-0700) Subject: systemd-sleep: (bug) honor s2h and hybrid_sleep disable settings X-Git-Tag: v243-rc1~325^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7874583da33171a791d2da60e90b4d31ebc952ba;p=thirdparty%2Fsystemd.git systemd-sleep: (bug) honor s2h and hybrid_sleep disable settings --- diff --git a/src/shared/sleep-config.c b/src/shared/sleep-config.c index 32a22eebd2d..4026655809a 100644 --- a/src/shared/sleep-config.c +++ b/src/shared/sleep-config.c @@ -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");