fix lseek issue.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1032 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong
2010-10-29 05:58:07 +00:00
parent 0486182353
commit 5f85cb2f78
3 changed files with 20 additions and 2 deletions
+8 -1
View File
@@ -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;
}
/**