commit f701698297ec1d1230caaa9403362c3a2b95f5ed
Author: sin <[email protected]>
Date:   Fri Jan 16 16:19:29 2015 +0000

    Don't do a blocking open in ttytostr()

diff --git a/libutil/tty.c b/libutil/tty.c
index 0197f7e..bceb01e 100644
--- a/libutil/tty.c
+++ b/libutil/tty.c
@@ -72,7 +72,7 @@ ttytostr(int tty_maj, int tty_min, char *str, size_t n)
 
                if ((int)major(sb.st_rdev) == tty_maj &&
                    (int)minor(sb.st_rdev) == tty_min) {
-                       fd = open(path, O_RDONLY);
+                       fd = open(path, O_RDONLY | O_NONBLOCK);
                        if (fd < 0)
                                continue;
                        if (isatty(fd)) {

Reply via email to