grub2/0249-Fix-some-error-returning-weirdness-in-grub_menu_exec.patch

39 lines
1.1 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Mon, 10 Aug 2020 19:14:02 -0400
Subject: [PATCH] Fix some error returning weirdness in
grub_menu_execute_entry()
Signed-off-by: Peter Jones <pjones@redhat.com>
---
grub-core/normal/menu.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c
index 9ea1f411814..791eeb95d14 100644
--- a/grub-core/normal/menu.c
+++ b/grub-core/normal/menu.c
@@ -301,8 +301,8 @@ grub_menu_execute_entry(grub_menu_entry_t entry, int auto_boot)
if (err)
{
grub_print_error ();
- grub_errno = GRUB_ERR_NONE;
- return;
+ err = grub_errno = GRUB_ERR_NONE;
+ return err;
}
errs_before = grub_err_printed_errors;
@@ -315,7 +315,10 @@ grub_menu_execute_entry(grub_menu_entry_t entry, int auto_boot)
grub_env_context_open ();
menu = grub_zalloc (sizeof (*menu));
if (! menu)
- return;
+ {
+ err = grub_errno;
+ return err;
+ }
grub_env_set_menu (menu);
if (auto_boot)
grub_env_set ("timeout", "0");