sleep: clear EFI HibernateLocation if writing kernel config fails

Follow-up for f1f331a252
This commit is contained in:
Mike Yuan
2023-08-13 22:12:32 +01:00
committed by Luca Boccassi
parent 57ffa99daa
commit 031a399d87
+5 -1
View File
@@ -270,8 +270,12 @@ static int execute(
return r;
r = write_kernel_hibernate_location(hibernate_location);
if (r < 0)
if (r < 0) {
if (is_efi_boot())
(void) efi_set_variable(EFI_SYSTEMD_VARIABLE(HibernateLocation), NULL, 0);
return log_error_errno(r, "Failed to prepare for hibernation: %m");
}
}
r = write_mode(modes);