libpayload: Don't let USB/PC/serial keyboards overwrite each other
Change-Id: I75c0066cf737e0cecac056487215622e2b3d4467
Signed-off-by: Dave Frodin <dave.frodin@se-eng.com>
Reviewed-on: http://review.coreboot.org/1981
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
diff --git a/payloads/libpayload/curses/pdcurses-backend/pdckbd.c b/payloads/libpayload/curses/pdcurses-backend/pdckbd.c
index 4558406..49b80c7 100644
--- a/payloads/libpayload/curses/pdcurses-backend/pdckbd.c
+++ b/payloads/libpayload/curses/pdcurses-backend/pdckbd.c
@@ -149,14 +149,14 @@
#ifdef CONFIG_PC_KEYBOARD
if ((curses_flags & F_ENABLE_CONSOLE) &&
- keyboard_havechar()) {
+ keyboard_havechar() && (c==0)) {
c = keyboard_getchar();
}
#endif
#ifdef CONFIG_SERIAL_CONSOLE
if ((curses_flags & F_ENABLE_SERIAL) &&
- serial_havechar()) {
+ serial_havechar() && (c==0)) {
c = cook_serial(serial_getchar());
}
#endif