efivars: if OsIndicationsSupported does not exist, assume that reboot-to-firmware is not available

It's not advertised and hence not available.

Fixes: #7424
This commit is contained in:
Lennart Poettering 2017-11-23 22:05:46 +01:00
parent e22c567fea
commit 846ab104ca
1 changed files with 2 additions and 0 deletions

View File

@ -119,6 +119,8 @@ int efi_reboot_to_firmware_supported(void) {
return -EOPNOTSUPP;
r = efi_get_variable(EFI_VENDOR_GLOBAL, "OsIndicationsSupported", NULL, &v, &s);
if (r == -ENOENT) /* variable doesn't exist? it's not supported then */
return -EOPNOTSUPP;
if (r < 0)
return r;
if (s != sizeof(uint64_t))