update dfs.c dfs_file.c dfs_file.h

Signed-off-by: yangfasheng <yangfasheng@rt-thread.com>
This commit is contained in:
yangfasheng
2019-01-09 17:40:32 +08:00
parent 8d7dae447c
commit c16d3de633
3 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -320,7 +320,7 @@ int fd_is_open(const char *pathname)
fd = fdt->fds[index];
if (fd == NULL || fd->fops == NULL || fd->path == NULL) continue;
if (fd->fops == fs->ops->fops && strcmp(fd->path, mountpath) == 0)
if (fd->fs == fs && strcmp(fd->path, mountpath) == 0)
{
/* found file in file descriptor table */
rt_free(fullpath);
+2 -1
View File
@@ -66,7 +66,8 @@ int dfs_file_open(struct dfs_fd *fd, const char *path, int flags)
}
LOG_D("open in filesystem:%s", fs->ops->name);
fd->fops = fs->ops->fops; /* set file ops */
fd->fs = fs; /* set file system */
fd->fops = fs->ops->fops; /* set file ops */
/* initialize the fd item */
fd->type = FT_REGULAR;