diff options
| author | HubretXie <[email protected]> | 2019-01-08 09:45:54 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-01-08 09:45:54 +0800 |
| commit | adfefdb05f31e4cc2d002a65b96666606273259b (patch) | |
| tree | a8d91ae3e3cb6e32850b8ae6bd3e6335aae0c019 /components/libc/compilers | |
| parent | c51f27797e332cb9a73cfbde7b1370a8ca59684d (diff) | |
| parent | 3d95a0359782157ad266f4bbc55a45dc22465e3e (diff) | |
Merge pull request #2 from RT-Thread/master
sync
Diffstat (limited to 'components/libc/compilers')
| -rw-r--r-- | components/libc/compilers/armlibc/stubs.c | 5 | ||||
| -rw-r--r-- | components/libc/compilers/dlib/sys/errno.h | 15 | ||||
| -rw-r--r-- | components/libc/compilers/newlib/syscalls.c | 4 |
3 files changed, 7 insertions, 17 deletions
diff --git a/components/libc/compilers/armlibc/stubs.c b/components/libc/compilers/armlibc/stubs.c index 6e9f13d143..820daeff39 100644 --- a/components/libc/compilers/armlibc/stubs.c +++ b/components/libc/compilers/armlibc/stubs.c @@ -270,7 +270,10 @@ long _sys_flen(FILEHANDLE fh) int _sys_istty(FILEHANDLE fh) { - return 0; + if((STDIN <= fh) && (fh <= STDERR)) + return 1; + else + return 0; } int remove(const char *filename) diff --git a/components/libc/compilers/dlib/sys/errno.h b/components/libc/compilers/dlib/sys/errno.h deleted file mode 100644 index 1ecb58b74c..0000000000 --- a/components/libc/compilers/dlib/sys/errno.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2006-2018, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - */ -#ifndef SYS_ERRNO_H__ -#define SYS_ERRNO_H__ - -#include <rtthread.h> - - -#endif 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; |
