1 --- isatty.c.orig 2009-11-07 14:51:38.000000000 -0800
2 +++ isatty.c 2009-11-07 14:51:40.000000000 -0800
3 @@ -35,14 +35,22 @@ __FBSDID("$FreeBSD: src/lib/libc/gen/isa
7 +#include <sys/filio.h>
9 +#include <sys/ioctl.h>
20 - retval = (tcgetattr(fd, &t) != -1);
21 + if(ioctl(fd, FIODTYPE, &type) != -1) {
22 + if((retval = (type == D_TTY)) == 0)
25 + retval = (tcgetattr(fd, &t) != -1);