sleep-config: eat up errors only after debug logging about them

This commit is contained in:
Lennart Poettering 2018-07-25 21:43:09 +02:00
parent 3dea6886c2
commit 7474f15b2d
1 changed files with 6 additions and 2 deletions

View File

@ -139,12 +139,16 @@ int can_sleep_disk(char **types) {
return true;
/* If /sys is read-only we cannot sleep */
if (access("/sys/power/disk", W_OK) < 0)
if (access("/sys/power/disk", W_OK) < 0) {
log_debug_errno(errno, "/sys/power/disk is not writable: %m");
return false;
}
r = read_one_line_file("/sys/power/disk", &p);
if (r < 0)
if (r < 0) {
log_debug_errno(r, "Couldn't read /sys/power/disk: %m");
return false;
}
STRV_FOREACH(type, types) {
const char *word, *state;