diff options
| author | bernard.xiong <[email protected]> | 2010-10-29 05:58:07 +0000 |
|---|---|---|
| committer | bernard.xiong <[email protected]> | 2010-10-29 05:58:07 +0000 |
| commit | 5f85cb2f782c8c295cd2c41ff078fef99b5b5109 (patch) | |
| tree | 697e45224b49be668ef851edc35ee75ccd8555c9 /components/dfs/src | |
| parent | 048618235365d05b53524679ac04b88192f5b517 (diff) | |
fix lseek issue.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1032 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/dfs/src')
| -rw-r--r-- | components/dfs/src/dfs_file.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/components/dfs/src/dfs_file.c b/components/dfs/src/dfs_file.c index 05b082e4ae..a1b19941e1 100644 --- a/components/dfs/src/dfs_file.c +++ b/components/dfs/src/dfs_file.c @@ -290,12 +290,19 @@ int dfs_file_flush(struct dfs_fd* fd) */
int dfs_file_lseek(struct dfs_fd* fd, rt_off_t offset)
{
+ int result;
struct dfs_filesystem* fs = fd->fs;
if (fd == RT_NULL) return -DFS_STATUS_EINVAL;
if (fs->ops->lseek == RT_NULL) return -DFS_STATUS_ENOSYS;
- return fs->ops->lseek(fd, offset);
+ result = fs->ops->lseek(fd, offset);
+
+ /* update current position */
+ if (result >= 0)
+ fd->pos = result;
+
+ return result;
}
/**
|
