Loading...
gen/FreeBSD/isatty.c.patch Libc-763.13 Libc-391
--- Libc/Libc-763.13/gen/FreeBSD/isatty.c.patch
+++ Libc/Libc-391/gen/FreeBSD/isatty.c.patch
@@ -1,13 +1,11 @@
---- isatty.c.orig	2009-11-07 14:51:38.000000000 -0800
-+++ isatty.c	2009-11-07 14:51:40.000000000 -0800
-@@ -35,14 +35,22 @@ __FBSDID("$FreeBSD: src/lib/libc/gen/isa
+--- isatty.c.orig	Thu Jan 31 16:57:29 2002
++++ isatty.c	Sun May 18 00:50:20 2003
+@@ -39,14 +39,19 @@
  
  #include <termios.h>
  #include <unistd.h>
 +#include <sys/filio.h>
 +#include <sys/conf.h>
-+#include <sys/ioctl.h>
-+#include <errno.h>
  
  int
  isatty(fd)
@@ -18,10 +16,9 @@
  	struct termios t;
  
 -	retval = (tcgetattr(fd, &t) != -1);
-+	if(ioctl(fd, FIODTYPE, &type) != -1) {
-+	    if((retval = (type == D_TTY)) == 0)
-+		errno = ENOTTY;
-+	} else
++	if(ioctl(fd, FIODTYPE, &type) != -1)
++	    retval = (type == D_TTY);
++	else
 +	    retval = (tcgetattr(fd, &t) != -1);
  	return(retval);
  }