diff options
| author | [email protected] <[email protected]> | 2012-02-15 07:28:47 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2012-02-15 07:28:47 +0000 |
| commit | 6202b6c155dfd68fac6b75810501576decc5b9f4 (patch) | |
| tree | 698e41f72ea74e2836926e80e521cd89744f1e52 /components/dfs/src | |
| parent | 70463829c527df2c7bbb4d28951abcbacaa7bad9 (diff) | |
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
Diffstat (limited to 'components/dfs/src')
| -rw-r--r-- | components/dfs/src/dfs_posix.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/components/dfs/src/dfs_posix.c b/components/dfs/src/dfs_posix.c index 14ce10fa7a..f9608e4ac5 100644 --- a/components/dfs/src/dfs_posix.c +++ b/components/dfs/src/dfs_posix.c @@ -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);
|
