mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Fix tty device file accessibility test
Fixes ending up in a freeze when a tty device exists but is not readable.
This commit is contained in:
parent
952be06384
commit
ebd65400a1
1 changed files with 2 additions and 2 deletions
|
|
@ -52,8 +52,8 @@ void wait_for_tty_device(void)
|
||||||
/* Loop until device pops up */
|
/* Loop until device pops up */
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
/* Test for device file */
|
/* Test for accessible device file */
|
||||||
if (stat(option.tty_device, &status) == 0)
|
if (access(option.tty_device, R_OK) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Wait up to 1 second */
|
/* Wait up to 1 second */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue