From 8ee939ea9f395f95357612d64d9be8e9a6529e46 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Wed, 19 Nov 2008 20:56:22 +0000 Subject: 2008-11-19 Jeff Johnston * libc/sys/linux/bits/dirent.h: New header file. * libc/sys/linux/sys/dirent.h: Include instead of . * libc/posix/Makefile.am: Remove reallocf. * libc/posix/Makefile.in: Regenerated. * libc/posix/reallocf.c: Moved to... * libc/stdlib/reallocf.c: Here * libc/stdlib/malloc.c: Add reallocf documentation. * libc/include/stdlib.h: Add reallocf and _reallocf_r prototypes. * libc/stdlib/Makefile.am: Add reallocf. * libc/stdlib/Makefile.in: Regenerated. * libc/posix/_isatty.c: Set errno. --- newlib/libc/posix/_isatty.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'newlib/libc/posix/_isatty.c') diff --git a/newlib/libc/posix/_isatty.c b/newlib/libc/posix/_isatty.c index 7260211ef..7d6ccae7c 100644 --- a/newlib/libc/posix/_isatty.c +++ b/newlib/libc/posix/_isatty.c @@ -3,15 +3,19 @@ /* Dumb implementation so programs will at least run. */ #include +#include int _DEFUN(_isatty, (fd), int fd) { struct stat buf; - if (fstat (fd, &buf) < 0) + if (fstat (fd, &buf) < 0) { + errno = EBADF; return 0; + } if (S_ISCHR (buf.st_mode)) return 1; + errno = ENOTTY; return 0; } -- cgit v1.2.3