aboutsummaryrefslogtreecommitdiff
path: root/bterm.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-06-17 16:45:24 -0700
committerBruce Hill <bruce@bruce-hill.com>2019-06-17 16:45:24 -0700
commitfbfe8689a83884c88518b22f0b5bb2dbf453e408 (patch)
tree2c0737942714660f0cde2c099348bd678f012790 /bterm.h
parent8d5e68d4441228b0c101940a9b7189938e755130 (diff)
Changing IO code to no longer use poll() in favor of just reading input
and using VMIN and VTIME.
Diffstat (limited to 'bterm.h')
-rw-r--r--bterm.h7
1 files changed, 2 insertions, 5 deletions
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 <poll.h>
#include <stdio.h>
#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;
}
/*