Skip to content

Commit b6c2368

Browse files
committed
[libc][keil] remove libc_stdio_read() in __MICROLIB
1 parent e304538 commit b6c2368

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

components/libc/compilers/armlibc/syscalls.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,13 @@ int fgetc(FILE *f)
336336
#ifdef RT_USING_POSIX
337337
char ch;
338338

339-
if (libc_stdio_read(&ch, 1) == 1)
339+
if (libc_stdio_get_console() < 0)
340+
{
341+
LOG_W("Do not invoke standard output before initializing libc");
342+
return -1;
343+
}
344+
345+
if(read(STDIN_FILENO, &ch, 1) == 1)
340346
return ch;
341347
#endif
342348

0 commit comments

Comments
 (0)