[PATCH 4/6] acpi: s4: also check for file based swap files
Colin King
colin.king at canonical.com
Thu Jun 7 14:05:54 UTC 2018
From: Colin Ian King <colin.king at canonical.com>
The latest release of Ubuntu may be using file based swap
rather than raw device based swap, so check for this too.
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
src/acpi/s4/s4.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/acpi/s4/s4.c b/src/acpi/s4/s4.c
index ec4a6f98..cf72851a 100644
--- a/src/acpi/s4/s4.c
+++ b/src/acpi/s4/s4.c
@@ -46,7 +46,8 @@ static int s4_init(fwts_framework *fw)
fwts_list* swap_devs;
swap_devs = fwts_file_open_and_read("/proc/swaps");
- if (fwts_text_list_strstr(swap_devs, "/dev/") == NULL) {
+ if ((fwts_text_list_strstr(swap_devs, "/dev/") == NULL) &&
+ (fwts_text_list_strstr(swap_devs, "file") == NULL)) {
fwts_list_free(swap_devs, free);
fwts_failed(fw, LOG_LEVEL_MEDIUM, "NoSwap",
"Cannot run hibernate test - machine appears to have NO swap.");
--
2.17.0
More information about the fwts-devel
mailing list