summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/shell_common.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/shell/shell_common.c b/shell/shell_common.c
index bbc22ed..51c92d6 100644
--- a/shell/shell_common.c
+++ b/shell/shell_common.c
@@ -138,7 +138,13 @@ shell_builtin_read(void FAST_FUNC (*setvar)(const char *name, const char *val),
old_tty = tty;
if (nchars) {
tty.c_lflag &= ~ICANON;
- tty.c_cc[VMIN] = nchars < 256 ? nchars : 255;
+ // Setting it to more than 1 breaks poll():
+ // it blocks even if there's data. !??
+ //tty.c_cc[VMIN] = nchars < 256 ? nchars : 255;
+ /* reads would block only if < 1 char is available */
+ tty.c_cc[VMIN] = 1;
+ /* no timeout (reads block forever) */
+ tty.c_cc[VTIME] = 0;
}
if (read_flags & BUILTIN_READ_SILENT) {
tty.c_lflag &= ~(ECHO | ECHOK | ECHONL);