From 64f5e305e8997ff3b842040edd655ebf383891b3 Mon Sep 17 00:00:00 2001 From: Roman Shaposhnik Date: Mon, 4 Jan 2021 12:22:51 -0800 Subject: [PATCH] Quick hack to account for async evens getting coalesced Signed-off-by: Roman Shaposhnik --- src/styx/svcs/devcons.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/styx/svcs/devcons.c b/src/styx/svcs/devcons.c index 76cad25..83d0686 100644 --- a/src/styx/svcs/devcons.c +++ b/src/styx/svcs/devcons.c @@ -174,6 +174,7 @@ void readline(uv_async_t* key_wake) { char ch; +keep: if(qread(kbdq, &ch, 1) == 0) { print("null char\n"); } @@ -215,6 +216,8 @@ void readline(uv_async_t* key_wake) kbd.x = 0; } } + if (qlen(kbdq)) + goto keep; } void kbd_alloc(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) {