sleep: pass error we see to log function
This commit is contained in:
parent
1326de0158
commit
2c4702057b
|
@ -108,6 +108,9 @@ static int write_state(FILE **f, char **states) {
|
|||
char **state;
|
||||
int r = 0;
|
||||
|
||||
assert(f);
|
||||
assert(*f);
|
||||
|
||||
STRV_FOREACH(state, states) {
|
||||
int k;
|
||||
|
||||
|
@ -277,11 +280,11 @@ static int execute_s2h(const SleepConfig *sleep_config) {
|
|||
|
||||
r = execute(sleep_config->hibernate_modes, sleep_config->hibernate_states);
|
||||
if (r < 0) {
|
||||
log_notice_errno(r, "Couldn't hibernate, will try to suspend again.");
|
||||
log_notice_errno(r, "Couldn't hibernate, will try to suspend again: %m");
|
||||
|
||||
r = execute(sleep_config->suspend_modes, sleep_config->suspend_states);
|
||||
if (r < 0)
|
||||
return log_notice_errno(r, "Could neither hibernate nor suspend again, giving up.");
|
||||
return log_error_errno(r, "Could neither hibernate nor suspend, giving up: %m");
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue