mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-23 04:04:15 +08:00
fix bugs in lseek in dfs_posix.c and dfs_jffs2.c
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1946 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
@@ -199,11 +199,16 @@ off_t lseek(int fd, off_t offset, int whence)
|
||||
case DFS_SEEK_END:
|
||||
offset += d->size;
|
||||
break;
|
||||
|
||||
default:
|
||||
rt_set_errno(-DFS_STATUS_EINVAL);
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
if (offset < 0)
|
||||
{
|
||||
rt_set_errno(DFS_STATUS_EINVAL);
|
||||
rt_set_errno(-DFS_STATUS_EINVAL);
|
||||
return -1;
|
||||
}
|
||||
result = dfs_file_lseek(d, offset);
|
||||
|
||||
Reference in New Issue
Block a user