Explorar el Código

[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 hace 6 años
padre
commit
48848c2917
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  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)