Fix example for GNU/Linux emulation.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka
2021-02-09 16:38:13 +09:00
parent 7b7335bc5d
commit 66f08d87e4
2 changed files with 11 additions and 1 deletions

View File

@@ -1,5 +1,8 @@
2021-02-09 NIIBE Yutaka <gniibe@fsij.org>
* example-cdc-gnu-linux/sample.c (main): Handle timeout by canceling
input.
* chopstx-gnu-linux.c (voluntary_context_switch): Fix for the case
when chx_idle suggests no context switch (tp_prev == tp_next).

View File

@@ -179,7 +179,14 @@ main (int argc, const char *argv[])
if (size < 0)
goto connection_loop;
if (size == 1)
if (size == 0)
/* Timeout */
{
if (tty_send (tty, "\r\n", 2) < 0)
return 0;
break;
}
else if (size == 1)
/* Do nothing but prompt again. */
break;
else if (size)