diff options
| author | [email protected] <[email protected]> | 2012-02-11 07:29:30 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2012-02-11 07:29:30 +0000 |
| commit | 2a858f931611adb069c2d585585feb459c14e1ce (patch) | |
| tree | 2b5ad5aad5e47e4478127c9bb8264f4833c82139 /components/dfs | |
| parent | 29df97e5cd32cacf66a7670719da3feaa7fd4723 (diff) | |
add an option to jump relatvie dir '.' and '..' in jffs2
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1943 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/dfs')
| -rw-r--r-- | components/dfs/filesystems/jffs2/dfs_jffs2.c | 6 | ||||
| -rw-r--r-- | components/dfs/filesystems/jffs2/jffs2_config.h | 12 |
2 files changed, 17 insertions, 1 deletions
diff --git a/components/dfs/filesystems/jffs2/dfs_jffs2.c b/components/dfs/filesystems/jffs2/dfs_jffs2.c index 77c0a71f1d..176f7c65f0 100644 --- a/components/dfs/filesystems/jffs2/dfs_jffs2.c +++ b/components/dfs/filesystems/jffs2/dfs_jffs2.c @@ -287,8 +287,12 @@ static int dfs_jffs2_open(struct dfs_fd* file) /* open dir */ result = jffs2_opendir(mte, mte->root, name, jffs2_file); if (result) + { return jffs2_result_to_dfs(result); - + } +#ifdef CONFIG_JFFS2_NO_RELATIVEDIR + jffs2_file->f_offset = 2; +#endif /* save this pointer, it will be used by dfs_jffs2_getdents*/ file->data = jffs2_file; return 0; diff --git a/components/dfs/filesystems/jffs2/jffs2_config.h b/components/dfs/filesystems/jffs2/jffs2_config.h index 9a8e2c565b..f07d7760f8 100644 --- a/components/dfs/filesystems/jffs2/jffs2_config.h +++ b/components/dfs/filesystems/jffs2/jffs2_config.h @@ -7,6 +7,18 @@ #define DEVICE_PART_MAX 1 /* the max partions on a nand deivce*/ + +/* jffs2 support relative dir, command "ls" will get + * +-------------------------------+ + * | finsh>>ls("/") | + * | Directory /: | + * | . <DIR> | + * | .. <DIR> | + * | dir1 <DIR> | + * +-------------------------------+ + */ +#define CONFIG_JFFS2_NO_RELATIVEDIR + #define CYGPKG_FS_JFFS2_RET_DIRENT_DTYPE /* should be enabled */ #if defined(CYGPKG_FS_JFFS2_RET_DIRENT_DTYPE) #define CYGPKG_FILEIO_DIRENT_DTYPE |
