GNU/Linux: Fix the example.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka
2021-02-10 14:49:19 +09:00
parent eaa47d5059
commit 27791641aa

View File

@@ -904,15 +904,15 @@ tty_recv (struct tty *t, char *buf, uint32_t *timeout)
chopstx_mutex_lock (&t->mtx);
r = check_rx (t);
chopstx_mutex_unlock (&t->mtx);
if (r || (timeout != NULL && *timeout == 0))
if (r)
break;
else if (timeout != NULL && *timeout == 0)
{
int i;
/* Cancel the input. */
for (i = 0; i < t->inputline_len; i++)
{
tty_echo_char (t, 0x08);
tty_echo_char (t, 0x20);
tty_echo_char (t, 0x08);
}
tty_send (t, "\x08\x20\x08", 3);
t->inputline_len = 0;
break;
}