Don't do a blocking open in ttytostr()

This commit is contained in:
sin 2015-01-16 16:19:29 +00:00
parent a7a561ef00
commit f701698297

View File

@ -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)) {