提交 3e6f64fe 编写于 作者: L lizhen9880

the file description is modified to local variable in function

static void copydir(const char * src, const char * dst)
上级 b588d819
...@@ -568,7 +568,6 @@ void rm(const char *filename) ...@@ -568,7 +568,6 @@ void rm(const char *filename)
} }
} }
FINSH_FUNCTION_EXPORT(rm, remove files or directories); FINSH_FUNCTION_EXPORT(rm, remove files or directories);
void cat(const char* filename) void cat(const char* filename)
{ {
rt_uint32_t length; rt_uint32_t length;
...@@ -655,8 +654,8 @@ static void copydir(const char * src, const char * dst) ...@@ -655,8 +654,8 @@ static void copydir(const char * src, const char * dst)
struct dirent dirent; struct dirent dirent;
struct stat stat; struct stat stat;
int length; int length;
struct dfs_fd cpfd;
if (dfs_file_open(&fd, src, DFS_O_DIRECTORY) < 0) if (dfs_file_open(&cpfd, src, DFS_O_DIRECTORY) < 0)
{ {
rt_kprintf("open %s failed\n", src); rt_kprintf("open %s failed\n", src);
return ; return ;
...@@ -665,7 +664,7 @@ static void copydir(const char * src, const char * dst) ...@@ -665,7 +664,7 @@ static void copydir(const char * src, const char * dst)
do do
{ {
rt_memset(&dirent, 0, sizeof(struct dirent)); rt_memset(&dirent, 0, sizeof(struct dirent));
length = dfs_file_getdents(&fd, &dirent, sizeof(struct dirent)); length = dfs_file_getdents(&cpfd, &dirent, sizeof(struct dirent));
if (length > 0) if (length > 0)
{ {
char * src_entry_full = RT_NULL; char * src_entry_full = RT_NULL;
...@@ -708,7 +707,7 @@ static void copydir(const char * src, const char * dst) ...@@ -708,7 +707,7 @@ static void copydir(const char * src, const char * dst)
} }
}while(length > 0); }while(length > 0);
dfs_file_close(&fd); dfs_file_close(&cpfd);
} }
static const char *_get_path_lastname(const char *path) static const char *_get_path_lastname(const char *path)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册