summaryrefslogtreecommitdiff
path: root/components/dfs
diff options
context:
space:
mode:
Diffstat (limited to 'components/dfs')
-rw-r--r--components/dfs/filesystems/elmfat/dfs_elm.c6
-rw-r--r--components/dfs/filesystems/ramfs/dfs_ramfs.c6
-rw-r--r--components/dfs/filesystems/romfs/dfs_romfs.c2
-rw-r--r--components/dfs/src/dfs.c8
-rw-r--r--components/dfs/src/dfs_file.c10
-rw-r--r--components/dfs/src/dfs_fs.c8
-rw-r--r--components/dfs/src/dfs_posix.c2
7 files changed, 21 insertions, 21 deletions
diff --git a/components/dfs/filesystems/elmfat/dfs_elm.c b/components/dfs/filesystems/elmfat/dfs_elm.c
index b7cdaf8522..eb57034061 100644
--- a/components/dfs/filesystems/elmfat/dfs_elm.c
+++ b/components/dfs/filesystems/elmfat/dfs_elm.c
@@ -265,7 +265,7 @@ int dfs_elm_mkfs(rt_device_t dev_id)
/* [IN] Format options */
/* [-] Working buffer */
/* [IN] Size of working buffer */
- memset(&opt, 0, sizeof(opt));
+ rt_memset(&opt, 0, sizeof(opt));
opt.fmt = FM_ANY|FM_SFD;
result = f_mkfs(logic_nbr, &opt, work, FF_MAX_SS);
rt_free(work); work = RT_NULL;
@@ -792,7 +792,7 @@ int dfs_elm_stat(struct dfs_filesystem *fs, const char *path, struct stat *st)
tmp >>= 6;
hour = tmp & 0x1F; /* bit[15:11] Hour(0..23) */
- memset(&tm_file, 0, sizeof(tm_file));
+ rt_memset(&tm_file, 0, sizeof(tm_file));
tm_file.tm_year = year - 1900; /* Years since 1900 */
tm_file.tm_mon = mon - 1; /* Months *since* january: 0-11 */
tm_file.tm_mday = day; /* Day of the month: 1-31 */
@@ -957,7 +957,7 @@ DWORD get_fattime(void)
/* converts calendar time time into local time. */
p_tm = gmtime(&now);
/* copy the statically located variable */
- memcpy(&tm_now, p_tm, sizeof(struct tm));
+ rt_memcpy(&tm_now, p_tm, sizeof(struct tm));
/* unlock scheduler. */
rt_exit_critical();
diff --git a/components/dfs/filesystems/ramfs/dfs_ramfs.c b/components/dfs/filesystems/ramfs/dfs_ramfs.c
index cc58590de2..781626633f 100644
--- a/components/dfs/filesystems/ramfs/dfs_ramfs.c
+++ b/components/dfs/filesystems/ramfs/dfs_ramfs.c
@@ -106,7 +106,7 @@ int dfs_ramfs_read(struct dfs_fd *file, void *buf, size_t count)
length = file->size - file->pos;
if (length > 0)
- memcpy(buf, &(dirent->data[file->pos]), length);
+ rt_memcpy(buf, &(dirent->data[file->pos]), length);
/* update file current position */
file->pos += length;
@@ -143,7 +143,7 @@ int dfs_ramfs_write(struct dfs_fd *fd, const void *buf, size_t count)
}
if (count > 0)
- memcpy(dirent->data + fd->pos, buf, count);
+ rt_memcpy(dirent->data + fd->pos, buf, count);
/* update file current position */
fd->pos += count;
@@ -442,7 +442,7 @@ struct dfs_ramfs *dfs_ramfs_create(rt_uint8_t *pool, rt_size_t size)
ramfs->memheap.parent.type = RT_Object_Class_MemHeap | RT_Object_Class_Static;
/* initialize root directory */
- memset(&(ramfs->root), 0x00, sizeof(ramfs->root));
+ rt_memset(&(ramfs->root), 0x00, sizeof(ramfs->root));
rt_list_init(&(ramfs->root.list));
ramfs->root.size = 0;
strcpy(ramfs->root.name, ".");
diff --git a/components/dfs/filesystems/romfs/dfs_romfs.c b/components/dfs/filesystems/romfs/dfs_romfs.c
index 2e9b08cbf6..9e355471a8 100644
--- a/components/dfs/filesystems/romfs/dfs_romfs.c
+++ b/components/dfs/filesystems/romfs/dfs_romfs.c
@@ -147,7 +147,7 @@ int dfs_romfs_read(struct dfs_fd *file, void *buf, size_t count)
length = file->size - file->pos;
if (length > 0)
- memcpy(buf, &(dirent->data[file->pos]), length);
+ rt_memcpy(buf, &(dirent->data[file->pos]), length);
/* update file current position */
file->pos += length;
diff --git a/components/dfs/src/dfs.c b/components/dfs/src/dfs.c
index d3a859e287..0299465a99 100644
--- a/components/dfs/src/dfs.c
+++ b/components/dfs/src/dfs.c
@@ -55,18 +55,18 @@ int dfs_init(void)
}
/* clear filesystem operations table */
- memset((void *)filesystem_operation_table, 0, sizeof(filesystem_operation_table));
+ rt_memset((void *)filesystem_operation_table, 0, sizeof(filesystem_operation_table));
/* clear filesystem table */
- memset(filesystem_table, 0, sizeof(filesystem_table));
+ rt_memset(filesystem_table, 0, sizeof(filesystem_table));
/* clean fd table */
- memset(&_fdtab, 0, sizeof(_fdtab));
+ rt_memset(&_fdtab, 0, sizeof(_fdtab));
/* create device filesystem lock */
rt_mutex_init(&fslock, "fslock", RT_IPC_FLAG_PRIO);
#ifdef DFS_USING_WORKDIR
/* set current working directory */
- memset(working_directory, 0, sizeof(working_directory));
+ rt_memset(working_directory, 0, sizeof(working_directory));
working_directory[0] = '/';
#endif
diff --git a/components/dfs/src/dfs_file.c b/components/dfs/src/dfs_file.c
index 711a461e20..a798bd3c59 100644
--- a/components/dfs/src/dfs_file.c
+++ b/components/dfs/src/dfs_file.c
@@ -543,11 +543,11 @@ void ls(const char *pathname)
rt_kprintf("Directory %s:\n", path);
do
{
- memset(&dirent, 0, sizeof(struct dirent));
+ rt_memset(&dirent, 0, sizeof(struct dirent));
length = dfs_file_getdents(&fd, &dirent, sizeof(struct dirent));
if (length > 0)
{
- memset(&stat, 0, sizeof(struct stat));
+ rt_memset(&stat, 0, sizeof(struct stat));
/* build full path for each file */
fullpath = dfs_normalize_path(path, dirent.d_name);
@@ -607,7 +607,7 @@ void cat(const char *filename)
do
{
- memset(buffer, 0, sizeof(buffer));
+ rt_memset(buffer, 0, sizeof(buffer));
length = dfs_file_read(&fd, buffer, sizeof(buffer) - 1);
if (length > 0)
{
@@ -692,7 +692,7 @@ static void copydir(const char *src, const char *dst)
do
{
- memset(&dirent, 0, sizeof(struct dirent));
+ rt_memset(&dirent, 0, sizeof(struct dirent));
length = dfs_file_getdents(&cpfd, &dirent, sizeof(struct dirent));
if (length > 0)
@@ -716,7 +716,7 @@ static void copydir(const char *src, const char *dst)
break;
}
- memset(&stat, 0, sizeof(struct stat));
+ rt_memset(&stat, 0, sizeof(struct stat));
if (dfs_file_stat(src_entry_full, &stat) != 0)
{
rt_kprintf("open file: %s failed\n", dirent.d_name);
diff --git a/components/dfs/src/dfs_fs.c b/components/dfs/src/dfs_fs.c
index 53e7e385a4..2abad9dfeb 100644
--- a/components/dfs/src/dfs_fs.c
+++ b/components/dfs/src/dfs_fs.c
@@ -323,7 +323,7 @@ int dfs_mount(const char *device_name,
{
/* The underlying device has error, clear the entry. */
dfs_lock();
- memset(fs, 0, sizeof(struct dfs_filesystem));
+ rt_memset(fs, 0, sizeof(struct dfs_filesystem));
goto err1;
}
@@ -339,7 +339,7 @@ int dfs_mount(const char *device_name,
/* mount failed */
dfs_lock();
/* clear filesystem table entry */
- memset(fs, 0, sizeof(struct dfs_filesystem));
+ rt_memset(fs, 0, sizeof(struct dfs_filesystem));
goto err1;
}
@@ -403,7 +403,7 @@ int dfs_unmount(const char *specialfile)
rt_free(fs->path);
/* clear this filesystem table entry */
- memset(fs, 0, sizeof(struct dfs_filesystem));
+ rt_memset(fs, 0, sizeof(struct dfs_filesystem));
dfs_unlock();
rt_free(fullpath);
@@ -590,7 +590,7 @@ int dfs_unmount_device(rt_device_t dev)
rt_free(fs->path);
/* clear this filesystem table entry */
- memset(fs, 0, sizeof(struct dfs_filesystem));
+ rt_memset(fs, 0, sizeof(struct dfs_filesystem));
dfs_unlock();
diff --git a/components/dfs/src/dfs_posix.c b/components/dfs/src/dfs_posix.c
index e6336c2544..5b26f190ce 100644
--- a/components/dfs/src/dfs_posix.c
+++ b/components/dfs/src/dfs_posix.c
@@ -639,7 +639,7 @@ DIR *opendir(const char *name)
}
else
{
- memset(t, 0, sizeof(DIR));
+ rt_memset(t, 0, sizeof(DIR));
t->fd = fd;
}