Skip to content

Commit

Permalink
[components][finsh]在RT_USING_POSIX_STDIO时,使用get_console获取当前console描述符
Browse files Browse the repository at this point in the history
  • Loading branch information
judecumt authored and mysterywolf committed Nov 5, 2024
1 parent 96165a5 commit bdf5a1f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion components/finsh/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
#include <fcntl.h>
#endif /* DFS_USING_POSIX */

#ifdef RT_USING_POSIX_STDIO
#include <unistd.h>
#include <posix/stdio.h>
#endif /* RT_USING_POSIX_STDIO */

/* finsh thread */
#ifndef RT_USING_HEAP
static struct rt_thread finsh_thread;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit bdf5a1f

Please sign in to comment.