diff options
| author | HubretXie <[email protected]> | 2019-04-02 16:07:28 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-04-02 16:07:28 +0800 |
| commit | dc2ee97e66d63f408798956ca52398a953a3691a (patch) | |
| tree | 809490db47a5e764c196a6b91d5f4d3daa108afe /components/libc | |
| parent | 1e16a1ef23135d54b8e8972909b9c64fa815ed9d (diff) | |
| parent | 762cdcc2721673c643b8864de534336d21ca129e (diff) | |
Merge pull request #1 from RT-Thread/master
SYNC
Diffstat (limited to 'components/libc')
| -rw-r--r-- | components/libc/compilers/armlibc/sys/types.h | 6 | ||||
| -rw-r--r-- | components/libc/compilers/dlib/sys/types.h | 6 | ||||
| -rw-r--r-- | components/libc/compilers/minilibc/sys/types.h | 11 | ||||
| -rw-r--r-- | components/libc/libdl/dlmodule.c | 4 |
4 files changed, 23 insertions, 4 deletions
diff --git a/components/libc/compilers/armlibc/sys/types.h b/components/libc/compilers/armlibc/sys/types.h index 4c76dfc429..001ace4dd2 100644 --- a/components/libc/compilers/armlibc/sys/types.h +++ b/components/libc/compilers/armlibc/sys/types.h @@ -15,6 +15,10 @@ typedef rt_int32_t clockid_t; typedef rt_int32_t key_t; /* Used for interprocess communication. */ typedef rt_int32_t pid_t; /* Used for process IDs and process group IDs. */ -typedef signed long ssize_t; /* Used for a count of bytes or an error indication. */ +#ifndef ARCH_CPU_64BIT +typedef signed int ssize_t; /* Used for a count of bytes or an error indication. */ +#else +typedef long signed int ssize_t; /* Used for a count of bytes or an error indication. */ +#endif #endif diff --git a/components/libc/compilers/dlib/sys/types.h b/components/libc/compilers/dlib/sys/types.h index 4c76dfc429..001ace4dd2 100644 --- a/components/libc/compilers/dlib/sys/types.h +++ b/components/libc/compilers/dlib/sys/types.h @@ -15,6 +15,10 @@ typedef rt_int32_t clockid_t; typedef rt_int32_t key_t; /* Used for interprocess communication. */ typedef rt_int32_t pid_t; /* Used for process IDs and process group IDs. */ -typedef signed long ssize_t; /* Used for a count of bytes or an error indication. */ +#ifndef ARCH_CPU_64BIT +typedef signed int ssize_t; /* Used for a count of bytes or an error indication. */ +#else +typedef long signed int ssize_t; /* Used for a count of bytes or an error indication. */ +#endif #endif diff --git a/components/libc/compilers/minilibc/sys/types.h b/components/libc/compilers/minilibc/sys/types.h index 0c00a79d1e..d3abc6bb38 100644 --- a/components/libc/compilers/minilibc/sys/types.h +++ b/components/libc/compilers/minilibc/sys/types.h @@ -8,10 +8,17 @@ */ #ifndef __TYPES_H__ #define __TYPES_H__ +#include <rtconfig.h> typedef long off_t; -typedef unsigned long size_t; -typedef signed long ssize_t; /* Used for a count of bytes or an error indication. */ + +#ifndef ARCH_CPU_64BIT +typedef unsigned int size_t; +typedef signed int ssize_t; /* Used for a count of bytes or an error indication. */ +#else +typedef long unsigned int size_t; +typedef long signed int ssize_t; /* Used for a count of bytes or an error indication. */ +#endif typedef unsigned char u_char; typedef unsigned short u_short; diff --git a/components/libc/libdl/dlmodule.c b/components/libc/libdl/dlmodule.c index 0029c01728..14cbfe4cfb 100644 --- a/components/libc/libdl/dlmodule.c +++ b/components/libc/libdl/dlmodule.c @@ -442,6 +442,10 @@ struct rt_dlmodule* dlmodule_load(const char* filename) close(fd); fd = -1; } + else + { + goto __exit; + } /* check ELF header */ if (rt_memcmp(elf_module->e_ident, RTMMAG, SELFMAG) != 0 && |
