4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-02-22 04:35:24 +08:00

[libc][newlib][syscalls] fileno(stdout)->STDOUT_FILENO

This commit is contained in:
Meco Man 2021-09-27 07:02:41 -04:00
parent 86bb54fde6
commit 8e287cfdf7

View File

@ -12,8 +12,9 @@
*/ */
#include <reent.h> #include <reent.h>
#include <errno.h> #include <sys/errno.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h>
#include <sys/time.h> #include <sys/time.h>
#include <rtthread.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 #ifndef RT_USING_DFS
#if defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE) #if defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE)
if (fileno(stdout) == fd) if (STDOUT_FILENO == fd)
{ {
rt_device_t console; rt_device_t console;