aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bb.c5
-rw-r--r--bterm.h7
2 files changed, 5 insertions, 7 deletions
diff --git a/bb.c b/bb.c
index 8aed841..6e04403 100644
--- a/bb.c
+++ b/bb.c
@@ -6,6 +6,7 @@
#include <dirent.h>
#include <fcntl.h>
#include <limits.h>
+#include <poll.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
@@ -196,8 +197,8 @@ void init_term(void)
}
memcpy(&bb_termios, &orig_termios, sizeof(bb_termios));
cfmakeraw(&bb_termios);
- bb_termios.c_cc[VMIN] = 0;
- bb_termios.c_cc[VTIME] = 0;
+ bb_termios.c_cc[VMIN] = 1;
+ bb_termios.c_cc[VTIME] = 1;
if (tcsetattr(fileno(tty_out), TCSAFLUSH, &bb_termios) == -1)
err("Couldn't tcsetattr");
update_term_size(0);
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;
}
/*