From 005e6f2ab8cf2dd9a2c7801d0bd02729a1535233 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Tue, 14 May 2019 09:52:49 -0700 Subject: [PATCH] Revert "Don't service ioport completions if data is available on stdin" This reverts commit 0453023f7b67717eb66bc8923ba74a0adb90bb66. This broke the history tests. Reverting this while I sort it out. --- src/input_common.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/input_common.cpp b/src/input_common.cpp index dc89f2b75..fb82b1842 100644 --- a/src/input_common.cpp +++ b/src/input_common.cpp @@ -134,6 +134,13 @@ static char_event_t readb() { } } + if (ioport > 0 && FD_ISSET(ioport, &fdset)) { + iothread_service_completion(); + if (auto mc = s_lookahead->pop_evt()) { + return *mc; + } + } + if (FD_ISSET(STDIN_FILENO, &fdset)) { unsigned char arr[1]; if (read_blocked(0, arr, 1) != 1) { @@ -144,15 +151,6 @@ static char_event_t readb() { // We read from stdin, so don't loop. return arr[0]; } - - // Check for iothread completions only if there is no data to be read from the stdin. - // This gives priority to the foreground. - if (ioport > 0 && FD_ISSET(ioport, &fdset)) { - iothread_service_completion(); - if (auto mc = s_lookahead->pop_evt()) { - return *mc; - } - } } } }