diff options
author | Jan Janssen <medhefgo@web.de> | 2019-10-30 17:44:59 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-11-19 10:37:37 +0100 |
commit | 0b9a2a9a9868e5494c039382bbd04dbb49d4cd41 (patch) | |
tree | 027d53771f0fe1e64d87dbfa034933dc8129317b | |
parent | 24e02f8d49b61d5573dcaa126906fe972cb8aad8 (diff) | |
download | systemd-0b9a2a9a9868e5494c039382bbd04dbb49d4cd41.tar.gz |
sd-boot: Silence compiler warning when building with -O2
(cherry picked from commit d9690d8fe9016783ef164c9a006e30987c359c6f)
-rw-r--r-- | src/boot/efi/boot.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c index fd0c972951..fb7abd1f38 100644 --- a/src/boot/efi/boot.c +++ b/src/boot/efi/boot.c @@ -515,7 +515,6 @@ static BOOLEAN menu_run( BOOLEAN exit = FALSE; BOOLEAN run = TRUE; BOOLEAN wait = FALSE; - BOOLEAN cleared_screen = FALSE; graphics_mode(FALSE); uefi_call_wrapper(ST->ConIn->Reset, 2, ST->ConIn, FALSE); @@ -527,16 +526,13 @@ static BOOLEAN menu_run( if (config->console_mode_change != CONSOLE_MODE_KEEP) { err = console_set_mode(&config->console_mode, config->console_mode_change); - if (!EFI_ERROR(err)) - cleared_screen = TRUE; - } - - if (!cleared_screen) + if (EFI_ERROR(err)) { + uefi_call_wrapper(ST->ConOut->ClearScreen, 1, ST->ConOut); + Print(L"Error switching console mode to %ld: %r.\r", (UINT64)config->console_mode, err); + } + } else uefi_call_wrapper(ST->ConOut->ClearScreen, 1, ST->ConOut); - if (config->console_mode_change != CONSOLE_MODE_KEEP && EFI_ERROR(err)) - Print(L"Error switching console mode to %ld: %r.\r", (UINT64)config->console_mode, err); - err = uefi_call_wrapper(ST->ConOut->QueryMode, 4, ST->ConOut, ST->ConOut->Mode->Mode, &x_max, &y_max); if (EFI_ERROR(err)) { x_max = 80; |