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:
Martin Lund 2016-04-24 23:30:19 +02:00
parent 952be06384
commit ebd65400a1

View file

@ -52,8 +52,8 @@ void wait_for_tty_device(void)
/* Loop until device pops up */
while (true)
{
/* Test for device file */
if (stat(option.tty_device, &status) == 0)
/* Test for accessible device file */
if (access(option.tty_device, R_OK) == 0)
return;
/* Wait up to 1 second */