From 38c49099c9f8fdca5d3e057e3458894f8b7994d2 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Fri, 28 Dec 2018 21:41:01 +0800 Subject: [PATCH] [libc] Fix the printf issue when disable DFS --- components/libc/compilers/newlib/syscalls.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/libc/compilers/newlib/syscalls.c b/components/libc/compilers/newlib/syscalls.c index e4cda478cb..759feafe67 100644 --- a/components/libc/compilers/newlib/syscalls.c +++ b/components/libc/compilers/newlib/syscalls.c @@ -9,6 +9,8 @@ #include #include #include +#include + #include #ifdef RT_USING_DFS @@ -218,7 +220,7 @@ _ssize_t _write_r(struct _reent *ptr, int fd, const void *buf, size_t nbytes) { #ifndef RT_USING_DFS - if (fd == 0) + if (fileno(stdout) == fd) { rt_device_t console; -- GitLab