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>
This commit is contained in:
Peter Jones 2021-02-17 19:50:16 -05:00
parent e3325f8100
commit 146f9d8e8d

7
shim.c
View File

@ -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;
}