summaryrefslogtreecommitdiff
path: root/components/libc
diff options
context:
space:
mode:
authorjonas <[email protected]>2021-09-02 10:36:07 +0800
committerjonas <[email protected]>2021-09-02 10:36:07 +0800
commitd72ee7b6cc19e3b0d5721b2b5fa047ed1a5fc7c4 (patch)
treeab7034a4df4cb5171a68c2236f9f831c8cd27ed0 /components/libc
parentab43390fe2c0e672771b73cf610e739a419aa06f (diff)
parent8d175ab3d237dccc25450a8e12808fc87318eb2f (diff)
Merge branch 'master' of [email protected]:RT-Thread/rt-thread.git into bsp_hk32
# Conflicts: # .ignore_format.yml
Diffstat (limited to 'components/libc')
-rw-r--r--components/libc/compilers/armlibc/syscalls.c2
-rw-r--r--components/libc/compilers/common/dirent.h23
2 files changed, 15 insertions, 10 deletions
diff --git a/components/libc/compilers/armlibc/syscalls.c b/components/libc/compilers/armlibc/syscalls.c
index ce4c358993..be6041a663 100644
--- a/components/libc/compilers/armlibc/syscalls.c
+++ b/components/libc/compilers/armlibc/syscalls.c
@@ -302,7 +302,7 @@ int remove(const char *filename)
#endif
}
-#if defined(RT_USING_FINSH) && defined(FINSH_USING_MSH) && defined(RT_USING_MODULE) && defined(RT_USING_DFS)
+#if defined(RT_USING_FINSH) && defined(RT_USING_MODULE) && defined(RT_USING_DFS)
/* use system(const char *string) implementation in the msh */
#else
int system(const char *string)
diff --git a/components/libc/compilers/common/dirent.h b/components/libc/compilers/common/dirent.h
index bfba586093..a6353fd6f8 100644
--- a/components/libc/compilers/common/dirent.h
+++ b/components/libc/compilers/common/dirent.h
@@ -6,10 +6,14 @@
* Change Logs:
* Date Author Notes
*/
-#ifndef __RTT_DIRENT_H__
-#define __RTT_DIRENT_H__
+#ifndef __DIRENT_H__
+#define __DIRENT_H__
-#include <rtthread.h>
+#include <rtdef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/*
* dirent.h - format of directory entries
@@ -26,27 +30,28 @@
#define DT_REG 0x01
#define DT_DIR 0x02
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#ifndef HAVE_DIR_STRUCTURE
+#define HAVE_DIR_STRUCTURE
typedef struct
{
int fd; /* directory file */
char buf[512];
int num;
int cur;
-} DIR;
+}DIR;
#endif
#ifndef HAVE_DIRENT_STRUCTURE
+#define HAVE_DIRENT_STRUCTURE
+
+#define DIRENT_NAME_MAX 256
+
struct dirent
{
rt_uint8_t d_type; /* The type of the file */
rt_uint8_t d_namlen; /* The length of the not including the terminating null file name */
rt_uint16_t d_reclen; /* length of this record */
- char d_name[256]; /* The null-terminated file name */
+ char d_name[DIRENT_NAME_MAX]; /* The null-terminated file name */
};
#endif