소스 검색

[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
gbcwbz 6 년 전
부모
커밋
48848c2917
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      components/libc/compilers/armlibc/stubs.c

+ 4 - 1
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)