systemd-sleep: (bug) use resume_offset value if set

Use hibernation configuration as defined in
/sys/power/resume and /sys/power/resume_offset
if present before inspecting /proc/swaps and
attempting to calculate swapfile offset
This commit is contained in:
Zach Smith
2019-06-26 22:04:59 -07:00
parent a7c5865098
commit 2002d8cdae
3 changed files with 35 additions and 6 deletions
+1
View File
@@ -178,6 +178,7 @@ int find_hibernate_location(char **device, char **type, size_t *size, size_t *us
(void) fscanf(f, "%*s %*s %*s %*s %*s\n");
// TODO: sort swaps in priority order rather than using first successful option
for (i = 1;; i++) {
_cleanup_free_ char *dev_field = NULL, *type_field = NULL;
size_t size_field, used_field;