[libc][syscalls]将在libc初始化之前调用printf的行为下调为警告级别

This commit is contained in:
Meco Man
2021-09-27 07:49:25 -04:00
parent 37d4abb822
commit 0a799653df
4 changed files with 12 additions and 12 deletions
+4 -4
View File
@@ -152,8 +152,8 @@ int _sys_read(FILEHANDLE fh, unsigned char *buf, unsigned len, int mode)
#ifdef RT_USING_POSIX
if (libc_stdio_get_console() < 0)
{
LOG_E("invoke standard output before initializing libc");
return -1;
LOG_W("Do not invoke standard output before initializing libc");
return 0;
}
size = read(STDIN_FILENO, buf, len);
return len - size;
@@ -197,8 +197,8 @@ int _sys_write(FILEHANDLE fh, const unsigned char *buf, unsigned len, int mode)
#ifdef RT_USING_POSIX
if (libc_stdio_get_console() < 0)
{
LOG_E("invoke standard input before initializing libc");
return -1;
LOG_W("Do not invoke standard input before initializing libc");
return 0;
}
size = write(STDOUT_FILENO, buf, len);
return len - size;