提交 f31b11de 编写于 作者: Y yangfasheng

update armlibc/stdio.c

Signed-off-by: Nyangfasheng <yangfasheng@rt-thread.com>
上级 1abe8353
......@@ -65,11 +65,27 @@ int libc_stdio_get_console(void)
int libc_stdio_read(void *buffer, size_t size)
{
return read(std_fd, buffer, size);
if (std_fd >= 0)
{
return read(std_fd, buffer, size);
}
else
{
rt_kprintf("Illegal stdio input!\n");
return 0;
}
}
int libc_stdio_write(const void *buffer, size_t size)
{
return write(std_fd, buffer, size);
if (std_fd >= 0)
{
return write(std_fd, buffer, size);
}
else
{
rt_kprintf("Illegal stdio output!\n");
return size;
}
}
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册