mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Merge 91f81d2665 into 6fb3a64ba2
This commit is contained in:
commit
15f7944556
1 changed files with 7 additions and 0 deletions
|
|
@ -2536,6 +2536,13 @@ int tty_connect(void)
|
||||||
char* now = NULL;
|
char* now = NULL;
|
||||||
struct timeval tval_before = {}, tval_now, tval_result;
|
struct timeval tval_before = {}, tval_now, tval_result;
|
||||||
|
|
||||||
|
/* Check that device is not a directory */
|
||||||
|
if (fs_dir_exists(device_name))
|
||||||
|
{
|
||||||
|
tio_error_printf("Device path '%s' is a directory, not a tty device", device_name);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
/* Open tty device */
|
/* Open tty device */
|
||||||
device_fd = open(device_name, O_RDWR | O_NOCTTY | O_NONBLOCK);
|
device_fd = open(device_name, O_RDWR | O_NOCTTY | O_NONBLOCK);
|
||||||
if (device_fd < 0)
|
if (device_fd < 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue