mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Treat EOF on stdin as error
This commit is contained in:
parent
ef98fc7fa2
commit
2a03a05a49
1 changed files with 2 additions and 2 deletions
|
|
@ -79,7 +79,7 @@ void wait_for_tty_device(void)
|
||||||
|
|
||||||
/* Read one character */
|
/* Read one character */
|
||||||
status = read(STDIN_FILENO, &c_stdin[0], 1);
|
status = read(STDIN_FILENO, &c_stdin[0], 1);
|
||||||
if (status < 0)
|
if (status <= 0)
|
||||||
{
|
{
|
||||||
error_printf("Could not read from stdin");
|
error_printf("Could not read from stdin");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
|
@ -266,7 +266,7 @@ int connect_tty(void)
|
||||||
{
|
{
|
||||||
/* Input from stdin ready */
|
/* Input from stdin ready */
|
||||||
status = read(STDIN_FILENO, &c_stdin[0], 1);
|
status = read(STDIN_FILENO, &c_stdin[0], 1);
|
||||||
if (status < 0)
|
if (status <= 0)
|
||||||
{
|
{
|
||||||
error_printf("Could not read from stdin");
|
error_printf("Could not read from stdin");
|
||||||
goto error_read;
|
goto error_read;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue