X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=interactive.c;h=3af90a6814d79e248178a3e47ae04cd066a8efad;hb=181beb316afad036ac01a778544c5dec0a8d51c7;hp=8e61484009cb73b5842485d9168c48aaea9e0002;hpb=fdd8a22e1df57a8c9254e7d0074301e7dde2c557;p=paraslash.git diff --git a/interactive.c b/interactive.c index 8e614840..3af90a68 100644 --- a/interactive.c +++ b/interactive.c @@ -258,17 +258,6 @@ static void clear_bottom_line(void) rl_point = point; } -static bool input_available(void) -{ - fd_set rfds; - int ret; - - FD_ZERO(&rfds); - FD_SET(i9ep->ici->fds[0], &rfds); - ret = para_select(1, &rfds, NULL, 0); - return ret > 0; -} - static void i9e_line_handler(char *line) { int ret; @@ -309,7 +298,7 @@ static int i9e_post_select(__a_unused struct sched *s, __a_unused void *context) ret = 0; if (i9ep->caught_sigint) goto rm_btrn; - while (input_available()) { + while (read_ok(i9ep->ici->fds[0]) > 0) { if (i9ep->stdout_btrn) { while (i9ep->key_sequence_length < sizeof(i9ep->key_sequence) - 1) { buf = i9ep->key_sequence + i9ep->key_sequence_length; @@ -326,7 +315,7 @@ static int i9e_post_select(__a_unused struct sched *s, __a_unused void *context) i9ep->key_sequence_length++; rl_stuff_char((int)(unsigned char)*buf); rl_callback_read_char(); - if (!input_available()) + if (read_ok(i9ep->ici->fds[0]) <= 0) break; } i9ep->key_sequence_length = 0;