diff options
| author | Meco Man <[email protected]> | 2021-09-27 07:29:50 -0400 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2021-09-27 07:49:25 -0400 |
| commit | 0a799653df4ae4bcaeef78620768a1c8d6242d94 (patch) | |
| tree | c0820262509270d6d880db7c9c87ab458670b433 /components/libc/compilers/newlib | |
| parent | 37d4abb822c60872bf21f6a1bb0b61e8e1409cc7 (diff) | |
[libc][syscalls]将在libc初始化之前调用printf的行为下调为警告级别
Diffstat (limited to 'components/libc/compilers/newlib')
| -rw-r--r-- | components/libc/compilers/newlib/syscalls.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/components/libc/compilers/newlib/syscalls.c b/components/libc/compilers/newlib/syscalls.c index 1cb7475fe1..4c1dc82ad3 100644 --- a/components/libc/compilers/newlib/syscalls.c +++ b/components/libc/compilers/newlib/syscalls.c @@ -227,8 +227,8 @@ _ssize_t _read_r(struct _reent *ptr, int fd, void *buf, size_t nbytes) _ssize_t rc; if (libc_stdio_get_console() < 0 && fd == STDIN_FILENO) { - LOG_E("invoke standard input before initializing libc"); - return -1; + LOG_W("Do not invoke standard input before initializing libc"); + return 0; } rc = read(fd, buf, nbytes); return rc; @@ -303,8 +303,8 @@ _ssize_t _write_r(struct _reent *ptr, int fd, const void *buf, size_t nbytes) _ssize_t rc; if (libc_stdio_get_console() < 0 && fd == STDOUT_FILENO) { - LOG_E("invoke standard output before initializing libc"); - return -1; + LOG_W("Do not invoke standard output before initializing libc"); + return 0; } rc = write(fd, buf, nbytes); return rc; |
