From 61291b1e3ec0687f464a4c5b1ff17a1f944d52a0 Mon Sep 17 00:00:00 2001 From: Matt Fleming Date: Mon, 1 Jul 2013 10:28:15 +0100 Subject: [PATCH] conio: Fix pollchar() for serial console The check of the LSR value was inverted. This resulted in pollchar() always claiming that there was data to be read from the serial console. Signed-off-by: Matt Fleming --- core/conio.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/conio.c b/core/conio.c index 3b8a103..3d59485 100644 --- a/core/conio.c +++ b/core/conio.c @@ -161,8 +161,8 @@ __export int pollchar(void) /* Already-queued input? */ if (SerialTail == SerialHead) { /* LSR */ - data = !(inb(SerialPort + 5) & 1); - if (!data) { + data = inb(SerialPort + 5) & 1; + if (data) { /* MSR */ data = inb(SerialPort + 6); @@ -173,8 +173,7 @@ __export int pollchar(void) data = 1; else data = 0; - } else - data = 1; + } } else data = 1; sti(); -- 2.7.4