diff options
| author | Meco Man <[email protected]> | 2021-09-27 07:02:41 -0400 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2021-09-27 07:14:07 -0400 |
| commit | 8e287cfdf70da52937eebe59a1e2527775dd1f0c (patch) | |
| tree | 22c1f130cc89e0b9ca279df57110c1fe6d823b48 /components | |
| parent | 86bb54fde6f3ed59050d724a7e98defd7c4f47a9 (diff) | |
[libc][newlib][syscalls] fileno(stdout)->STDOUT_FILENO
Diffstat (limited to 'components')
| -rw-r--r-- | components/libc/compilers/newlib/syscalls.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/components/libc/compilers/newlib/syscalls.c b/components/libc/compilers/newlib/syscalls.c index d46a264408..7ba06312ea 100644 --- a/components/libc/compilers/newlib/syscalls.c +++ b/components/libc/compilers/newlib/syscalls.c @@ -12,8 +12,9 @@ */ #include <reent.h> -#include <errno.h> +#include <sys/errno.h> #include <stdio.h> +#include <unistd.h> #include <sys/time.h> #include <rtthread.h> @@ -219,7 +220,7 @@ _ssize_t _write_r(struct _reent *ptr, int fd, const void *buf, size_t nbytes) { #ifndef RT_USING_DFS #if defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE) - if (fileno(stdout) == fd) + if (STDOUT_FILENO == fd) { rt_device_t console; |
