summaryrefslogtreecommitdiff
path: root/components/libc/compilers
diff options
context:
space:
mode:
authorgbcwbz <[email protected]>2018-12-23 19:15:20 +0800
committergbcwbz <[email protected]>2018-12-23 19:15:20 +0800
commit48848c2917c42a8826b3144211a62093c86f086b (patch)
treeacd9d6147296c0281dccee69eeca6cd06ee951e8 /components/libc/compilers
parent0924d277f67258c7c264cab1287671bf04bea231 (diff)
[libc][armlibc] Fix getchar error after exit vi
- _sys_istty() add stdio as tty - without this, after exit vi program getchar will return -1, I don't know why it works
Diffstat (limited to 'components/libc/compilers')
-rw-r--r--components/libc/compilers/armlibc/stubs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/components/libc/compilers/armlibc/stubs.c b/components/libc/compilers/armlibc/stubs.c
index 6e9f13d143..820daeff39 100644
--- a/components/libc/compilers/armlibc/stubs.c
+++ b/components/libc/compilers/armlibc/stubs.c
@@ -270,7 +270,10 @@ long _sys_flen(FILEHANDLE fh)
int _sys_istty(FILEHANDLE fh)
{
- return 0;
+ if((STDIN <= fh) && (fh <= STDERR))
+ return 1;
+ else
+ return 0;
}
int remove(const char *filename)