From ebd65400a1ea70c39ff002bb2ad6f26d0438e472 Mon Sep 17 00:00:00 2001 From: Martin Lund Date: Sun, 24 Apr 2016 23:30:19 +0200 Subject: [PATCH] Fix tty device file accessibility test Fixes ending up in a freeze when a tty device exists but is not readable. --- src/tty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tty.c b/src/tty.c index bd5f3f4..007e3d7 100644 --- a/src/tty.c +++ b/src/tty.c @@ -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 */