grub2/0047-grub-core-term-at_keyboard.c-Tolerate-missing-keyboa.patch
Peter Jones 8c6b1ac71e Reconcile with upstream once again.
Also include some minor fixes for gcc 5.1.1

Signed-off-by: Peter Jones <pjones@redhat.com>
2015-07-22 09:46:32 -04:00

41 lines
1.2 KiB
Diff

From 7f64fb590cd80517e1381693a16d7cf2486fa808 Mon Sep 17 00:00:00 2001
From: Vladimir Serbinenko <phcoder@gmail.com>
Date: Sun, 26 Jan 2014 03:31:10 +0100
Subject: [PATCH 047/506] * grub-core/term/at_keyboard.c: Tolerate
missing keyboard.
---
ChangeLog | 4 ++++
grub-core/term/at_keyboard.c | 3 +++
2 files changed, 7 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index bbec1e7..d37d4a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-01-26 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * grub-core/term/at_keyboard.c: Tolerate missing keyboard.
+
2014-01-26 Mike Gilbert <floppym@gentoo.org>
grub-install: support for partitioned partx loop devices.
diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c
index f5071ce..b4257e8 100644
--- a/grub-core/term/at_keyboard.c
+++ b/grub-core/term/at_keyboard.c
@@ -396,6 +396,9 @@ fetch_key (int *is_break)
if (! KEYBOARD_ISREADY (grub_inb (KEYBOARD_REG_STATUS)))
return -1;
at_key = grub_inb (KEYBOARD_REG_DATA);
+ /* May happen if no keyboard is connected. Just ignore this. */
+ if (at_key == 0xff)
+ return -1;
if (at_key == 0xe0)
{
e0_received = 1;
--
2.4.3