summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2021-02-17 19:50:16 -0500
committerPeter Jones <pjones@redhat.com>2021-02-19 14:28:10 -0500
commit146f9d8e8d75eff8d3277a5416943877ed902c73 (patch)
tree31ff7ce3c5be03d44719ab2e2eaf809699e8e38e
parente3325f8100f5a14e0684ff80290e53975de1a5d9 (diff)
downloadefi-boot-shim-146f9d8e8d75eff8d3277a5416943877ed902c73.tar.gz
efi-boot-shim-146f9d8e8d75eff8d3277a5416943877ed902c73.zip
shim: use an enum for efi_main's error messages.
Numbering the error messages in efi_main directly was a mistake, and the following patches just make it more apparent. This makes it an enum so we don't have to re-number at more than one place when we add or remove them. Signed-off-by: Peter Jones <pjones@redhat.com>
-rw-r--r--shim.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/shim.c b/shim.c
index f9af1d83..57b86b19 100644
--- a/shim.c
+++ b/shim.c
@@ -1855,7 +1855,10 @@ efi_main (EFI_HANDLE passed_image_handle, EFI_SYSTEM_TABLE *passed_systab)
L"shim_init() failed",
NULL
};
- int msg = 0;
+ enum {
+ IMPORT_MOK_STATE,
+ SHIM_INIT,
+ } msg = IMPORT_MOK_STATE;
/*
* Set up the shim lock protocol so that grub and MokManager can
@@ -1911,7 +1914,7 @@ die:
efi_status = shim_init();
if (EFI_ERROR(efi_status)) {
- msg = 1;
+ msg = SHIM_INIT;
goto die;
}