diff options
| author | Bernard Xiong <[email protected]> | 2018-12-28 21:41:01 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2018-12-28 21:41:01 +0800 |
| commit | 38c49099c9f8fdca5d3e057e3458894f8b7994d2 (patch) | |
| tree | 826284c965047b66d9dc06a50ede0bfd50ad43f6 /components/libc/compilers/newlib/syscalls.c | |
| parent | d7ff010f91a4d622bb63bbbc7526fd897382df94 (diff) | |
[libc] Fix the printf issue when disable DFS
Diffstat (limited to 'components/libc/compilers/newlib/syscalls.c')
| -rw-r--r-- | components/libc/compilers/newlib/syscalls.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 <reent.h> #include <sys/errno.h> #include <sys/time.h> +#include <stdio.h> + #include <rtthread.h> #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; |
