diff options
| author | guo <[email protected]> | 2021-10-13 13:39:24 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-10-13 13:39:24 +0800 |
| commit | 0211f2fcc191f37a7a3eb54aadfbbc9d226d15f0 (patch) | |
| tree | 773b3ae4a0dd440080c9c7a28b2fec710f5a3e67 /components | |
| parent | e3045389d0b9e1157571c961cf77e271d0aaf3a7 (diff) | |
| parent | b6c2368bef902562e1572393285cbd1335710565 (diff) | |
Merge pull request #5161 from mysterywolf/libc
[libc][keil] remove libc_stdio_read() in __MICROLIB
Diffstat (limited to 'components')
| -rw-r--r-- | components/libc/compilers/armlibc/syscalls.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/components/libc/compilers/armlibc/syscalls.c b/components/libc/compilers/armlibc/syscalls.c index 3b1627d82a..ccdcfc86ea 100644 --- a/components/libc/compilers/armlibc/syscalls.c +++ b/components/libc/compilers/armlibc/syscalls.c @@ -336,7 +336,13 @@ int fgetc(FILE *f) #ifdef RT_USING_POSIX char ch; - if (libc_stdio_read(&ch, 1) == 1) + if (libc_stdio_get_console() < 0) + { + LOG_W("Do not invoke standard output before initializing libc"); + return -1; + } + + if(read(STDIN_FILENO, &ch, 1) == 1) return ch; #endif |
