mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-21 18:57:16 +08:00
fix lseek issue.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1032 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user