未验证 提交 a01c85dc 编写于 作者: B Bernard Xiong 提交者: GitHub

Merge pull request #1164 from uestczyh222/master

[Components][DFS][RAMFS]Fix bug
...@@ -42,7 +42,7 @@ int dfs_ramfs_mount(struct dfs_filesystem *fs, ...@@ -42,7 +42,7 @@ int dfs_ramfs_mount(struct dfs_filesystem *fs,
ramfs = (struct dfs_ramfs *)data; ramfs = (struct dfs_ramfs *)data;
fs->data = ramfs; fs->data = ramfs;
return RT_EOK; return RT_EOK;
} }
...@@ -189,8 +189,11 @@ int dfs_ramfs_open(struct dfs_fd *file) ...@@ -189,8 +189,11 @@ int dfs_ramfs_open(struct dfs_fd *file)
rt_size_t size; rt_size_t size;
struct dfs_ramfs *ramfs; struct dfs_ramfs *ramfs;
struct ramfs_dirent *dirent; struct ramfs_dirent *dirent;
struct dfs_filesystem *fs;
fs = (struct dfs_filesystem *)file->data;
ramfs = (struct dfs_ramfs *)file->data; ramfs = (struct dfs_ramfs *)fs->data;
RT_ASSERT(ramfs != NULL); RT_ASSERT(ramfs != NULL);
if (file->flags & O_DIRECTORY) if (file->flags & O_DIRECTORY)
...@@ -456,6 +459,7 @@ struct dfs_ramfs* dfs_ramfs_create(rt_uint8_t *pool, rt_size_t size) ...@@ -456,6 +459,7 @@ struct dfs_ramfs* dfs_ramfs_create(rt_uint8_t *pool, rt_size_t size)
rt_list_init(&(ramfs->root.list)); rt_list_init(&(ramfs->root.list));
ramfs->root.size = 0; ramfs->root.size = 0;
strcpy(ramfs->root.name, "."); strcpy(ramfs->root.name, ".");
ramfs->root.fs = ramfs;
return ramfs; return ramfs;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册