From dd973824c0225882b1eaff775ef5a0a71ee9b5de Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Sun, 19 Aug 2018 19:49:13 +0900 Subject: [PATCH] [bim] Invert #ifdef __linux__ to match #ifdef __toaru__ earlier --- apps/bim.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/bim.c b/apps/bim.c index 8ef01eba..f37eda6f 100644 --- a/apps/bim.c +++ b/apps/bim.c @@ -305,12 +305,10 @@ int bim_getch(void) { _bim_unget = -1; return out; } -#ifdef __linux__ - struct pollfd fds[1]; - fds[0].fd = global_config.tty_in; - fds[0].events = POLLIN; - int ret = poll(fds,1,200); - if (ret > 0 && fds[0].revents & POLLIN) { +#ifdef __toaru__ + int fds[] = {global_config.tty_in}; + int index = fswait2(1,fds,200); + if (index == 0) { unsigned char buf[1]; read(global_config.tty_in, buf, 1); return buf[0]; @@ -318,9 +316,11 @@ int bim_getch(void) { return -1; } #else - int fds[] = {global_config.tty_in}; - int index = fswait2(1,fds,200); - if (index == 0) { + struct pollfd fds[1]; + fds[0].fd = global_config.tty_in; + fds[0].events = POLLIN; + int ret = poll(fds,1,200); + if (ret > 0 && fds[0].revents & POLLIN) { unsigned char buf[1]; read(global_config.tty_in, buf, 1); return buf[0];