diff options
author | Tom Gundersen <teg@jklm.no> | 2015-04-10 19:43:36 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-04-10 19:55:49 +0200 |
commit | 9df49b33583e8a7d0a252bc5bd532fd2448ef0c8 (patch) | |
tree | 14fe7e0ef08fc1e97f8d029400d2560b4f8b57b7 /src/shared/efivars.c | |
parent | 3dc055541c570e93c817e42f451f7d3519629cbc (diff) |
shared: efivars - is_efi_*() returns bool instead of int
There was a bug where is_efi_*() could return a negative error value, which would be treated as 'true',
just make this a bool in the helper library to avoid the problem.
Diffstat (limited to 'src/shared/efivars.c')
-rw-r--r-- | src/shared/efivars.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/shared/efivars.c b/src/shared/efivars.c index b82f74a459..2a925f3970 100644 --- a/src/shared/efivars.c +++ b/src/shared/efivars.c @@ -87,12 +87,12 @@ static int read_flag(const char *varname) { return r; } -int is_efi_secure_boot(void) { - return read_flag("SecureBoot"); +bool is_efi_secure_boot(void) { + return read_flag("SecureBoot") > 0; } -int is_efi_secure_boot_setup_mode(void) { - return read_flag("SetupMode"); +bool is_efi_secure_boot_setup_mode(void) { + return read_flag("SetupMode") > 0; } int efi_reboot_to_firmware_supported(void) { |