Skip to content

Commit 8e287cf

Browse files
committed
[libc][newlib][syscalls] fileno(stdout)->STDOUT_FILENO
1 parent 86bb54f commit 8e287cf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

components/libc/compilers/newlib/syscalls.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
*/
1313

1414
#include <reent.h>
15-
#include <errno.h>
15+
#include <sys/errno.h>
1616
#include <stdio.h>
17+
#include <unistd.h>
1718
#include <sys/time.h>
1819

1920
#include <rtthread.h>
@@ -219,7 +220,7 @@ _ssize_t _write_r(struct _reent *ptr, int fd, const void *buf, size_t nbytes)
219220
{
220221
#ifndef RT_USING_DFS
221222
#if defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE)
222-
if (fileno(stdout) == fd)
223+
if (STDOUT_FILENO == fd)
223224
{
224225
rt_device_t console;
225226

0 commit comments

Comments
 (0)