summaryrefslogtreecommitdiff
path: root/components/dfs
diff options
context:
space:
mode:
authorqiuyiuestc <[email protected]>2010-08-27 13:44:45 +0000
committerqiuyiuestc <[email protected]>2010-08-27 13:44:45 +0000
commit82d4e498816ef3b7de1c3ebd401bb890ad195416 (patch)
tree6f0714d9d45f27e8341f099cae16d0df4a2cfcfc /components/dfs
parentd41f2f0830adb848dc622c9c70448fc8cb22edaf (diff)
fix dfs_stat issue
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@882 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/dfs')
-rw-r--r--components/dfs/filesystems/nfs/dfs_nfs.c2
-rw-r--r--components/dfs/src/dfs_file.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/components/dfs/filesystems/nfs/dfs_nfs.c b/components/dfs/filesystems/nfs/dfs_nfs.c
index a68f5f3c71..abd234e786 100644
--- a/components/dfs/filesystems/nfs/dfs_nfs.c
+++ b/components/dfs/filesystems/nfs/dfs_nfs.c
@@ -729,8 +729,6 @@ int nfs_stat(struct dfs_filesystem* fs, const char *path, struct _stat *st)
RT_ASSERT(fs->data != RT_NULL);
nfs = (struct nfs_filesystem *)fs->data;
- rt_kprintf("get path:%s stat\n", path);
-
handle = get_handle(nfs, path);
if(handle == RT_NULL)
return -1;
diff --git a/components/dfs/src/dfs_file.c b/components/dfs/src/dfs_file.c
index f09a7c4a1c..0d708d82fb 100644
--- a/components/dfs/src/dfs_file.c
+++ b/components/dfs/src/dfs_file.c
@@ -354,7 +354,11 @@ int dfs_file_stat(const char *path, struct _stat *buf)
return -DFS_STATUS_ENOSYS;
}
- result = fs->ops->stat(fs, fullpath, buf);
+ if (dfs_subdir(fs->path, fullpath) == RT_NULL)
+ result = fs->ops->stat(fs, "/", buf);
+ else
+ result = fs->ops->stat(fs, dfs_subdir(fs->path, fullpath), buf);
+
rt_free(fullpath);
return result;