mirror of
https://github.com/systemd/systemd.git
synced 2025-01-10 05:18:17 +03:00
sleep: when we can't hibernate on suspend-then-hibernate, fall back to suspend again
Let's make this a bit safer, and try hard to return to sleep, if we can at all. Fixes: #10212
This commit is contained in:
parent
14250f0942
commit
f05e1ae666
@ -263,7 +263,17 @@ static int execute_s2h(usec_t hibernate_delay_sec) {
|
||||
return 0;
|
||||
|
||||
/* If woken up after alarm time, hibernate */
|
||||
return execute(hibernate_modes, hibernate_states);
|
||||
r = execute(hibernate_modes, hibernate_states);
|
||||
if (r < 0) {
|
||||
log_notice("Couldn't hibernate, will try to suspend again.");
|
||||
r = execute(suspend_modes, suspend_states);
|
||||
if (r < 0) {
|
||||
log_notice("Could neither hibernate nor suspend again, giving up.");
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int help(void) {
|
||||
|
Loading…
Reference in New Issue
Block a user