This is the mail archive of the newlib-cvs@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] RISC-V: isatty: return 0 on error


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=f2c9e55faf6fa560c25d448afa7e2d1ad61468f2

commit f2c9e55faf6fa560c25d448afa7e2d1ad61468f2
Author: Chih-Mao Chen <cmchen@andestech.com>
Date:   Thu Nov 16 16:08:16 2017 +0800

    RISC-V: isatty: return 0 on error

Diff:
---
 libgloss/riscv/sys_isatty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libgloss/riscv/sys_isatty.c b/libgloss/riscv/sys_isatty.c
index 0dc3db1..8857f48 100644
--- a/libgloss/riscv/sys_isatty.c
+++ b/libgloss/riscv/sys_isatty.c
@@ -13,5 +13,5 @@ _isatty(int file)
 {
   struct stat s;
   int ret = _fstat (file, &s);
-  return ret == -1 ? -1 : !!(s.st_mode & S_IFCHR);
+  return ret == -1 ? 0 : !!(s.st_mode & S_IFCHR);
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]