diff --git a/library/changes b/library/changes index 8d45ac8..68dca3f 100644 --- a/library/changes +++ b/library/changes @@ -1,3 +1,5 @@ +- isatty() no longer crashes if passed a socket rather than a file. + - Rewrote the GetRexxVar()/SetRexxVar() functions (mostly) in 'C', using available code as a reference. The 68k stubs currently only work for the 68k version of the library, and a solution for the OS4 build still needs to be found. The code diff --git a/library/unistd_isatty.c b/library/unistd_isatty.c index cac620b..8e1b227 100644 --- a/library/unistd_isatty.c +++ b/library/unistd_isatty.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_isatty.c,v 1.9 2006-11-16 14:39:23 obarthel Exp $ + * $Id: unistd_isatty.c,v 1.10 2008-04-16 07:46:05 obarthel Exp $ * * :ts=4 * @@ -67,6 +67,12 @@ isatty(int file_descriptor) goto out; } + if(FLAG_IS_SET(fd->fd_Flags,FDF_IS_SOCKET)) + { + __set_errno(ENOTTY); + goto out; + } + __fd_lock(fd); result = 1;