diff --git a/components/finsh/shell.c b/components/finsh/shell.c index e698edd51f..a9aa830ecd 100644 --- a/components/finsh/shell.c +++ b/components/finsh/shell.c @@ -32,6 +32,11 @@ #include #endif /* DFS_USING_POSIX */ +#ifdef RT_USING_POSIX_STDIO +#include +#include +#endif /* RT_USING_POSIX_STDIO */ + /* finsh thread */ #ifndef RT_USING_HEAP static struct rt_thread finsh_thread; @@ -154,7 +159,7 @@ int finsh_getchar(void) #ifdef RT_USING_DEVICE char ch = 0; #ifdef RT_USING_POSIX_STDIO - if(read(STDIN_FILENO, &ch, 1) > 0) + if(read(rt_posix_stdio_get_console(), &ch, 1) > 0) { return ch; }