diff --git a/8250-serial.c b/8250-serial.c index 7aea383..232f6e8 100644 --- a/8250-serial.c +++ b/8250-serial.c @@ -77,6 +77,9 @@ static void serial8250__receive(struct kvm *self, struct serial8250_device *dev) { int c; + if (dev->lsr & UART_LSR_DR) + return; + if (!is_readable(fileno(stdin))) return; @@ -84,9 +87,6 @@ static void serial8250__receive(struct kvm *self, struct serial8250_device *dev) if (c < 0) return; - if (dev->lsr & UART_LSR_DR) - dev->lsr |= UART_LSR_OE; - dev->rbr = c; dev->lsr |= UART_LSR_DR; }