diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2010-08-27 15:55:36 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2010-08-27 15:55:36 +0400 |
commit | 95c929196bd915aa0435ea0ca61b43727abf8e93 (patch) | |
tree | deb06cd0f677844ca96f108ab8b6e8077cd999b8 | |
parent | 1165007539a2db492adc4aded73e081edb99be1e (diff) |
* syscalls.c (_isatty): Fix return value.
-rw-r--r-- | libgloss/ChangeLog | 4 | ||||
-rw-r--r-- | libgloss/arm/syscalls.c | 12 |
2 files changed, 13 insertions, 3 deletions
diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index 1c3e16267..522721553 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,7 @@ +2010-08-27 Christophe Lyon <christophe.lyon@st.com> + + * syscalls.c (_isatty): Fix return value. + 2010-07-23 Naveen.H.S <naveenh1@kpitcummins.com> Gina Verlekar <gina.verlekar@kpitcummins.com> diff --git a/libgloss/arm/syscalls.c b/libgloss/arm/syscalls.c index 0e0a5dae0..15cc69f61 100644 --- a/libgloss/arm/syscalls.c +++ b/libgloss/arm/syscalls.c @@ -770,24 +770,30 @@ int _isatty (int fd) { struct fdent *pfd; + int tty; pfd = findslot (fd); if (pfd == NULL) { errno = EBADF; - return -1; + return 0; } #ifdef ARM_RDI_MONITOR - return checkerror (do_AngelSWI (AngelSWI_Reason_IsTTY, &pfd->handle)); + tty = do_AngelSWI (AngelSWI_Reason_IsTTY, &pfd->handle); #else register r0 asm("r0"); r0 = pfd->handle; asm ("swi %a2" : "=r" (r0) : "0"(r0), "i" (SWI_IsTTY)); - return checkerror (r0); + tty = r0; #endif + + if (tty == 1) + return 1; + errno = get_errno (); + return 0; } int |