summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2019-04-12 00:09:50 +0800
committerGitHub <[email protected]>2019-04-12 00:09:50 +0800
commit16e8f34e468bd472a973467435731ad0fdd60251 (patch)
treea899a29838426af565fa28b25cfe4384fcb6350e /components
parent1370fd83266cd3d4a7d8c78583dd9210c004ced3 (diff)
parent9be085aa0498e3a56945b60a2e9ba788096f3319 (diff)
Merge pull request #2567 from zhaojuntao/fix-libc&errno
Fix libc&errno
Diffstat (limited to 'components')
-rw-r--r--components/libc/compilers/newlib/syscalls.c8
-rw-r--r--components/net/lwip-1.4.1/src/arch/include/arch/cc.h8
2 files changed, 10 insertions, 6 deletions
diff --git a/components/libc/compilers/newlib/syscalls.c b/components/libc/compilers/newlib/syscalls.c
index 759feafe67..9919e11727 100644
--- a/components/libc/compilers/newlib/syscalls.c
+++ b/components/libc/compilers/newlib/syscalls.c
@@ -27,6 +27,14 @@
/* Reentrant versions of system calls. */
+#ifndef _REENT_ONLY
+int *
+__errno ()
+{
+ return _rt_errno();
+}
+#endif
+
int
_close_r(struct _reent *ptr, int fd)
{
diff --git a/components/net/lwip-1.4.1/src/arch/include/arch/cc.h b/components/net/lwip-1.4.1/src/arch/include/arch/cc.h
index e0ad8cf588..06c0be6670 100644
--- a/components/net/lwip-1.4.1/src/arch/include/arch/cc.h
+++ b/components/net/lwip-1.4.1/src/arch/include/arch/cc.h
@@ -55,10 +55,8 @@ typedef uintptr_t mem_ptr_t;
#define X32_F "lx"
#ifdef RT_USING_LIBC
-#if defined(__CC_ARM) || defined(__IAR_SYSTEMS_ICC__)
-#include <sys/errno.h>
-#else
-#include <errno.h>
+#if !defined(__CC_ARM) && !defined(__IAR_SYSTEMS_ICC__)
+
/* some errno not defined in newlib */
#define ENSRNOTFOUND 163 /* Domain name not found */
/* WARNING: ESHUTDOWN also not defined in newlib. We chose
@@ -66,8 +64,6 @@ typedef uintptr_t mem_ptr_t;
in arch.h has been assigned to another error code. */
#define ESHUTDOWN 180
#endif /* __CC_ARM/__IAR_SYSTEMS_ICC__ */
-#else
-#define LWIP_PROVIDE_ERRNO
#endif
#if defined(RT_USING_LIBC) || defined(RT_USING_MINILIBC)