mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Do not quit on error
This makes gotty more robust in the sense it will not quit when an error occurs but simply continue to try reconnect.
This commit is contained in:
parent
c6c4a4b1dd
commit
9f38512285
1 changed files with 2 additions and 8 deletions
10
src/tty.c
10
src/tty.c
|
|
@ -145,17 +145,11 @@ int connect_tty(void)
|
|||
/* Open tty device */
|
||||
fd = open(option.tty_device, O_RDWR | O_NOCTTY );
|
||||
if (fd < 0)
|
||||
{
|
||||
printf("\033[300DError: %s\n\033[300D", strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
return EXIT_FAILURE;
|
||||
|
||||
/* Make sure device is of tty type */
|
||||
if (!isatty(fd))
|
||||
{
|
||||
printf("\033[300DError: Not a tty device\n\033[300D");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
return EXIT_FAILURE;
|
||||
|
||||
/* Flush stale I/O data (if any) */
|
||||
tcflush(fd, TCIOFLUSH);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue