From fbfe8689a83884c88518b22f0b5bb2dbf453e408 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 17 Jun 2019 16:45:24 -0700 Subject: Changing IO code to no longer use poll() in favor of just reading input and using VMIN and VTIME. --- bterm.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'bterm.h') diff --git a/bterm.h b/bterm.h index dbade7a..c233c84 100644 --- a/bterm.h +++ b/bterm.h @@ -10,7 +10,6 @@ #ifndef FILE__BTERM_H #define FILE__BTERM_H -#include #include #define KEY_F1 (0xFFFF-0) @@ -112,11 +111,9 @@ const char *bkeyname(int key); static inline int nextchar(int fd, int timeout) { + (void)timeout; char c; - struct pollfd pfd = {fd, POLLIN, 0}; - if (poll(&pfd, 1, timeout) > 0) - return read(fd, &c, 1) == 1 ? c : -1; - return -1; + return read(fd, &c, 1) == 1 ? c : -1; } /* -- cgit v1.2.3