Message ID | 20180607140556.8309-5-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
Series | enable PM debug messages for S3 + S4 (LP: #1772563) | expand |
On 2018-06-07 07:05 AM, Colin King wrote: > From: Colin Ian King <colin.king@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@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."); > Acked-by: Alex Hung <alex.hung@canonical.com>
On 06/07/2018 10:05 PM, Colin King wrote: > From: Colin Ian King <colin.king@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@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."); > Acked-by: Ivan Hu <ivan.hu@canonical.com>
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.");