GNU/Linux: Fix the example to cancel the input on timeout.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka
2021-02-10 10:18:42 +09:00
parent c1433f1520
commit b491d815e5
4 changed files with 20 additions and 8 deletions

View File

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