dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0205-blscfg-fix-compilation-on-EFI-and-EMU.patch

d9d99f
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
d9d99f
From: Will Thompson <wjt@endlessm.com>
d9d99f
Date: Thu, 12 Jul 2018 19:00:42 +0100
d9d99f
Subject: [PATCH] blscfg: fix compilation on !EFI and !EMU
d9d99f
MIME-Version: 1.0
d9d99f
Content-Type: text/plain; charset=UTF-8
d9d99f
Content-Transfer-Encoding: 8bit
d9d99f
d9d99f
Neither GRUB_MACHINE_EFI nor GRUB_MACHINE_EMU are defined when compiling
d9d99f
for (eg) i386-pc. In this case, #elif GRUB_MACHINE_EMU is an error:
d9d99f
d9d99f
  commands/blscfg.c: In function ‘grub_cmd_blscfg’:
d9d99f
  commands/blscfg.c:835:7: error: "GRUB_MACHINE_EMU" is not defined [-Werror=undef]
d9d99f
   #elif GRUB_MACHINE_EMU
d9d99f
         ^~~~~~~~~~~~~~~~
d9d99f
d9d99f
Signed-off-by: Will Thompson <wjt@endlessm.com>
d9d99f
---
d9d99f
 grub-core/commands/blscfg.c | 2 +-
d9d99f
 1 file changed, 1 insertion(+), 1 deletion(-)
d9d99f
d9d99f
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
d9d99f
index 11a356de81a..53676576ba5 100644
d9d99f
--- a/grub-core/commands/blscfg.c
d9d99f
+++ b/grub-core/commands/blscfg.c
d9d99f
@@ -843,7 +843,7 @@ grub_cmd_blscfg (grub_extcmd_context_t ctxt UNUSED,
d9d99f
   info.platform = PLATFORM_EFI;
d9d99f
   grub_dprintf ("blscfg", "scanning /EFI/\n");
d9d99f
   r = fs->dir (dev, "/EFI/", find_entry, &info;;
d9d99f
-#elif GRUB_MACHINE_EMU
d9d99f
+#elif defined(GRUB_MACHINE_EMU)
d9d99f
   info.platform = PLATFORM_EMU;
d9d99f
   grub_dprintf ("blscfg", "scanning %s%s\n", GRUB_BOOT_DEVICE,
d9d99f
 		GRUB_BLS_CONFIG_PATH);